Fix deadlock in sys_waitpid, and remove a bad error check
sys_fork now returns child process id