Electrostatic diagnostics of nanosecond pulsed electron beams in a Malmberg–Penning trap