Fix crash on exit when playback is running.