A cavity-QED scheme for Heisenberg-limited interferometry