Merge "RecordThread: Fix sp<> release with mutex held" into main