Oxygen diffusion and defect chemistry in rare-earth-doped BaTiO3