Reaction mechanism in the high-pressure synthesis of Hg-cuprates: an in-situ synchrotron diffraction study