Fix a crash on exit during playback