windows: make uv_read_stop immediately stop reading

This implements locking around the blocking call to ReadFile to get
around a Windows kernel bug where a blocking ReadFile operation on a
stream can deadlock the thread. This allows uv_read_stop to immediately
cancel a pending IO operation, and allows uv_pipe_getsockname to
"pause" any pending read (from libuv) while it retrieves the
sockname information.

If unsupported by the OS (pre-Vista), this reverts to the old
(e.g. deadlock-prone) behavior

Closes #1313
windows: fix uv__getaddrinfo_translate_error

Use Windows socket error codes, as recommended by MSDN, like we already
do with GetNameInfoW.
netbsd: fix build

Thanks @ezra1!

Closes #1391
unix, windows: add uv_recv_buffer_size and uv_send_buffer_size
windows: add support for UNC paths on uv_spawn
test: fix udp_multicast_interface6 on FreeBSD
test: skip UDP dualstack test on BSDs

As of right now Linux comes with bindv6only=0 by default but BSDs use
bindv6only=1. It can be changed systemwide with sysctl, but it's not
nice to depend on the environment for running tests, so disable it just
on BSDs.
test: fix spawn_reads_child_path when using autoconf

Don't hardcode the name of the executable, take it from the exepath.

Fixes #1407
windows: fix build on MinGW
unix: fix typedef of uv_buf_t

Typedefs of unnamed structs cannot be forward declared.
Giving the uv_buf_t struct a name makes forward declarations possible.
windows: replace use of inet_addr with uv_inet_pton

Fixes a compilation warning with Visual Studio 2013.
unix: replace some asserts with returning errors
windows: use OpenBSD implementation for uv_fs_mkdtemp
windows: fix GetNameInfoW error handling

GetNameInfoW return non-zero on error, and not vice versa.
fs: introduce uv_readdir_next() and report types

Introduce:

    int uv_fs_readdir_next(uv_fs_t* req, uv_dirent_t* ent);

`uv_fs_readdir()` is not returning a file names list in `req->ptr`
anymore, the proper way to gather them is to call `uv_fs_readdir_next()`
in a callback.
fs: extend reported types in  uv_fs_readdir_next

Support all possible types on Unix, and files, directories and links on
Windows. Some systems (hello SunOS!) don't have the d_type field on struct
dirent, so mark them as UV_DIRENT_UNKNOWN.
unix: fix colliding flag value

Fixes #1425
unix: read on stream even when UV__POLLHUP set.

This fixes a SmartOS specific issue that happens when reading from
a stream that is the reading end of a pipe that has been closed by
the parent process.

In this case, a UV__POLLHUP event would be set on the stream and would
prevent the event loop from closing it. As a result, the event loop
would think there are stil handles open, and leave the process
hanging.

Fixes #1419.
2014.08.20, Version 0.11.29 (Unstable)

Changes since version 0.11.28:

* windows: make uv_read_stop immediately stop reading (Jameson Nash)

* windows: fix uv__getaddrinfo_translate_error (Alexis Campailla)

* netbsd: fix build (Saúl Ibarra Corretgé)

* unix, windows: add uv_recv_buffer_size and uv_send_buffer_size
  (Andrius Bentkus)

* windows: add support for UNC paths on uv_spawn (Paul Goldsmith)

* windows: replace use of inet_addr with uv_inet_pton (Saúl Ibarra
  Corretgé)

* unix: replace some asserts with returning errors (Andrius Bentkus)

* windows: use OpenBSD implementation for uv_fs_mkdtemp (Pavel Platto)

* windows: fix GetNameInfoW error handling (Alexis Campailla)

* fs: introduce uv_readdir_next() and report types (Fedor Indutny)

* fs: extend reported types in uv_fs_readdir_next (Saúl Ibarra Corretgé)

* unix: read on stream even when UV__POLLHUP set. (Julien Gilli)
Now working on v0.11.30