Fix: deadlock in Scheduler/Recorder: use RLock instead of Lock