Line integration of Ricci curvature and conjugate points in Lorentzian and Riemannian manifolds