Measurement of the longitudinal and transverse diffusion of single electrons drifting in gases