Dynamics of a qubit-oscillator system with periodically varying coupling