In situ control of oxygen vacancies in TiO2 by atomic layer deposition for resistive switching devices