General relativistic treatment of the Colella-Overhauser-Werner experiment on neutron interference in a gravitational field