Confinement reduces surface accumulation of swimming bacteria