Diffusion of intrinsic defects in dielectric and semiconductor crystals with impurities