Scavenging of oxygen from SrTiO3 during oxide thin film deposition and the formation of interfacial 2DEGs