[server][ChildProcessManager] Fix a potential problem that stalls when the wait thread is in waitid().