Refactor signal handling

This moves signal handling out of os_unix.c and into libuv event loop. The
actual handlers are in signal.c.