We should be using wait_process(), not waitpid() directly.