Fix use of waitpid().