On the spectral flow in Lorentzian manifolds