A long-path second-harmonic interferometer with ns time resolution. A reliable diagnostic tool for electron density measurement in pulsed plasma devices