Mechanism of solid-state conversion of non-stoichiometric hydroxyapatite to diphase calcium phosphate