Spectral deferred correction methods for second-order problems