Heteroclinic orbits on noncompact Riemannian manifolds