unix: correct error when calling uv_shutdown twice

Before this one of the requests was left as a ghost in the system.
See https://github.com/JuliaLang/julia/issues/5793
unix: correct error when calling uv_shutdown twice

This is a backport of a284b90 for v0.10 branch
windows: fix building on MinGW

The crtdbg.h header was added in c0716b3d, but MinGW does not have this
header present on the system. This commit takes the same approach of
2684f876a and just ignores this header and functionality on MinGW
windows: always initialize uv_process_t

The unix implementation of uv_spawn always starts out with a
uv__handle_init, but the windows implementation sometimes bails out
early before calling uv__handle_init. This means that uv_close on a
failed uv_spawn will always succeed on unix but sometimes fail on
windows.

This commit lifts the initialization of the uv_process_t above all of
the error checking to ensure that uv_close will always work when
uv_spawn returns an error.
include: expose libuv version in header files
fs: vectored IO API for filesystem read/write

This improves API consistency with uv_read and uv_write and may
improve efficiency for some uses. Vectored IO is emulated when the
requisite system calls are unavailable.
build, windows: fixed x64 configuration issue
windows: fixed compilation warning
build: update dtrace m4 check for sunos

The check to see if -G is needed for dtrace requires a bit more effort,
make a header, c file, and object file.
Revert "fs: vectored IO API for filesystem read/write"

This reverts commit 7df24583e5ea77086e765a4bf0773407f0ec190d.
windows: freeze in uv_tcp_endgame

The event_handle field of unused accept requests was not being
initialized properly. As a result, uv_tcp_endgame would try to close
an invalid handle and this could lead to unexpected behavior.

This fixes node.js test test-cluster-disconnect.js on Windows.
Merge branch 'v0.10'

Conflicts:
	build.mk
	test/test-shutdown-twice.c
sunos: handle rearm errors

fix #1078
Merge branch 'v0.10'

Conflicts:
	src/unix/sunos.c
unix: use a heap for timers

Replace the red-black tree with a heap.  The most common operation that
libuv performs on timers is looking up the first timer to expire.  With
a red-black tree, that operation is O(log n).  With a heap, it's O(1).
linux: always deregister closing fds from epoll

If the same file description is open in two different processes, then
closing the file descriptor is not sufficient to deregister it from the
epoll instance (as described in epoll(7)), resulting in spurious events
that cause the event loop to spin repeatedly. So always explicitly
deregister it.

Fixes #1099.
test: fix VC++ warning C4244
linux: include grp.h for setgroups()
unix, windows: add uv_loop_init and uv_loop_close

These functions supersede uv_loop_new and uv_loop_delete.
uv_loop_init initialized a user allocated loop and uv_loop_close
removes all associated resources a loop uses after it has finished
execution.

uv_loop_new and uv_loop_delete are now deprecated.
unix, windows: add uv_getrusage() function