Oscillating large-scale circulation in turbulent Rayleigh-Bénard convection