linux: make uv_cpu_info() handle absent procfs

Return an error when reading from /proc files fails because the procfs
isn't mounted.
windows: link with advapi32 and shell32 libraries

Older versions of GYP would set up the Visual Studio project to link
with these libraries by default, but this was changed in r1584 (see
https://codereview.chromium.org/12256017).

Closes #728
unix: handle POLLERR and POLLHUP in uv__stream_io

Fixes a busy loop when the file descriptor emits POLLHUP but not POLLIN
or POLLOUT, e.g. when polling the read end of a pipe and the write end
is closed.

Fixes joyent/node#4923.
win/tty: fix case where uv_read_start incorrectly reports failure

In very rare circumstances a uv_read_start() call on a uv_tty_t handle
in raw mode would return -1 but there was no actual failure. This patch
fixes that.
win/tty: don't touch insert mode or quick edit mode

Hopefully this fixes joyent/node#4809.
win/tty: fix typo in color attributes enumeration
unix: honor UV_THREADPOOL_SIZE environment var

Make the size of the thread pool configurable through an environment
variable. For sanity reasons, the size is clamped to the range 1-128.
unix: fix strict aliasing warnings, macro-ify functions

Replace a few internal functions in uv-common.h with macros to avoid
strict aliasing warnings with older versions of gcc.

It's not smart enough to figure out that e.g. a uv_tcp_t is an instance
of uv_handle_t with similar alignment requirements and therefore no
aliasing happens. More recent versions of gcc don't suffer from this.

I'm not normally in the habit of catering to compiler defects but the
aliasing warnings drown out legitimate warnings, hence the change.
unix: add STATIC_ASSERT macro
unix: add uv_buf_t static asserts to core.c

Verify that our uv_buf_t type is ABI-compatible with struct iovec.
unix: fix strict aliasing warning in udp.c
unix: replace volatile cast with ACCESS_ONCE macro
unix: please valgrind, free memory in threadpool.c
win: Map ERROR_INVALID_FUNCTION to EISDIR

This error is raised when calling read() or write() on a directory.

A bit of googling turns up some cases where this error can be raised
that are not properly mapped to EISDIR, but are also cases that libuv
doesn't really care about, like the Password Manager API,
GetFirmwareEnvironmentVariable, or CreateTapePartition.

If libuv ever needs to handle these cases, then I suppose that the
ERROR_INVALID_FUNCTION->EISDIR mapping could be done directly in the
fs read() and write() functions, but doing so at this point seems
premature, as it makes the error code mapping a bit more messy.

Fixes joyent/node#4951
win: fix potential HANDLE corruption due to incorrect cast

Closes #738.
win/tcp: don't enable iocp sync bypass when iocp emulation is used

When iocp sync bypass is in use libuv doesn't expect the system to
generate events when an i/o operation completes synchronously. However
when iocp emulation is enabled an event will always be generated because
SetFileCompletionNotificationModes() doesn't stop OVERLAPPED.hEvent from
becoming signaled.

This should fix joyent/node#4959.
Merge tag 'node-v0.10.0'

Node v0.10.0