Structural and complex impedance spectroscopic studies of Mg-substituted CoFe2O4