Stop the metronome when closing the app.