Atom localization via Ramsey interferometry: A coherent cavity field provides a better resolution