Work and work-energy theorem in curved spacetime