The improved textural properties, thermal stability, and cytocompatibility of mesoporous hydroxyapatite by Mg2+ doping