Band gap tuning and defects suppression upon Mg doping in electrospun ZnO nanowires