Timeline: Fix potential deadlock when stopping recording.