Electrochemical impedance spectroscopy analysis of ZnO films: the effect of Mg doping