Phase transitions and CO2 adsorption properties of polymeric magnesium formate