unix: set O_NONBLOCK in uv_pipe_open()

Don't rely on the caller to set the O_NONBLOCK flag on the file
descriptor.

Prevents sporadic stalls when the file descriptor is in blocking mode
and exactly as many bytes are read as there are available; in that case,
libuv will try to read again and block.  Node.js was guilty of this.

Fixes #941.
Revert "unix: set O_NONBLOCK in uv_pipe_open()"

It turns out that node.js relies on the blocking behavior of pipes in
some cases, notably when forking worker processes.  Reopens #941.

This reverts commit 8fe4ca686bcb069f670b0381e89c008ca814f8ba.
unix: fix uv_spawn() NULL pointer deref on ENOMEM

In the cleanup-after-error section of uv_spawn(), check that the pointer
is non-NULL - we might end up in said section due to a malloc() failure.
unix: don't close inherited fds on uv_spawn() fail

The cleanup-after-error code path in uv_spawn() was closing file
descriptors indiscriminately.  Only close file descriptors that we
created ourselves, not the ones that are passed in by the user.

Fixes joyent/node#6297.
unix: revert recent FSEvent changes

This commit reverts the following commits:

    983fa68 darwin: fix 10.6 build error in fsevents.c
    684e212 fsevents: use shared FSEventStream
    ea4cb77 fsevents: FSEvents is most likely not thread-safe
    9bae606 darwin: create fsevents thread on demand

Several people have reported stability issues on OS X 10.8 and bus
errors on the 10.9 developer preview.

See also joyent/node#6296 and joyent/node#6251.
unix: fix non-synchronized access in signal.c

Check the return value of uv__signal_lock(); don't mutate the signal
watcher tree in the signal handler if we failed to acquire the lock.
2013.10.19, Version 0.10.18 (Stable)

Changes since version 0.10.17:

* unix: fix uv_spawn() NULL pointer deref on ENOMEM (Ben Noordhuis)

* unix: don't close inherited fds on uv_spawn() fail (Ben Noordhuis)

* unix: revert recent FSEvent changes (Ben Noordhuis)

* unix: fix non-synchronized access in signal.c (Ben Noordhuis)
Now working on v0.10.19