Real-time correction of betatron tune ripples on a slowly extracted beam