Thermodynamic investigation on the Mg–Pd intermetallic phases