Fix waitpid() return value on error.