build: handle bad gcc -dumpversion output

`gcc -dumpversion` usually prints major.minor - but on sunos it prints
major.minor.patch.
unix: handle EINPROGRESS for unix sockets

Before this commit, it was assumed that connect() on UNIX sockets never
returns EINPROGRESS. It turned out to be a bad assumption: Dave Pacheco
reports sporadic hangups on SmartOS because of that.

It's not clear to me _why_ the Illumos kernel returns that error but
that's inconsequential: whatever the cause, libuv needs to handle it
and now it does.

This is a back-port of commit 3348cd7 from the master branch.

Fixes joyent/node#4785.

Conflicts:
	src/unix/pipe.c
test: add tap output

Given UV_TAP_OUTPUT being set, test result output should use TAP formatting

This is a back-port of commit bfe269b from the master branch.

Conflicts:
	test/runner-unix.c
test: don't rewind_cursor when using tap_output

This is a back-port of commit 72bbf5d from the master branch.
linux: make uv_cpu_info() handle absent procfs

Return an error when reading from /proc files fails because the procfs
isn't mounted.

This is a back-port of commit 7e59f9b from the master branch.
test: fix tap output check

Only report as an error when status != 0.

Stops the platform_output test from being reported as having failed
on Jenkins.

This is a back-port of commit 1821bba from the master branch.
test: fix tap output even when ok but have output

This is a back-port of commit 49d2ae3 from the master branch.
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
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

This is a back-port of 4abad23, whichi is supposed to fix
joyent/node#4809.

The private `original_console_mode` field in the uv_tty_t struct has
been renamed, but couldn't be removed because changing the ABI isn't
allowed on stable branches.
win/tty: fix typo in color attributes enumeration
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