process: provide a way to mark a process as terminating
posix: fix a race condition in waitpid() that happened with programs using SIGCHLD to reap children.