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>
libc: implement pause() and select() with nfds=0 and timeout=NULL

Erlang's main thread use select(0,NULL,NULL,NULL,NULL) to sleep forever.

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>