Ag-mediated charge transfer from electron-doped SrTiO3 to CO and NO: A first-principles study