Critical thickness of BaSnO3 buffer layer for YBa2Cu3O7−δ thin films on MgO substrates