Phase Transitions and CO2 Adsorption Properties of Polymeric Magnesium Formate