Enhanced Photocatalytic Activity of Mg-Doped ZnO Nanorods Prepared by Electrodeposition