First-principles study of self-diffusion in hcp Mg and Zn