Merge "Fix race in checking exitPending() in RecordThread::threadLoop()"