Decomposition mechanism of magnesium amide Mg(NH2)2