Structural, thermal, dielectric and phonon properties of perovskite-like imidazolium magnesium formate.