Fixed a race condition in process status checking.