Merge pull request #5803 from leoetlino/pause-and-lock Replace balanced Core::PauseAndLock calls with RunAsCPUThread