libc: Fix waitpid return code

waitpid should return -1 on error. returning 0 means a child process
whose pid is 0 has exited. This will confuse Erlang's child waiter
thread.

Signed-off-by: bhuztez <bhuztez@gmail.com>
Reviewed-by: Nadav Har'El <nyh@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>