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.
test: add tap output for windows
unix: fix uv_tcp_simultaneous_accepts() logic

Inverts the meaning of the 'enable' argument. Before, it actually set
the UV_TCP_SINGLE_ACCEPT flag when enable=1. Now it clears it, which is
what uv-win does and what you would expect it to do.
include: bump UV_VERSION_MINOR

Fixes #740.
unix: improve uv_guess_handle() implementation

Make it understand FIFOs, character devices and sockets.
stream: run try_select only for pipes and ttys

Its not necesary for TCP and other streams, since fd is always working
with kqueue there.
build: rename OS to PLATFORM

Rename the OS make variable to PLATFORM, it conflicts with the OS env
var. That is, running `make` when the OS env var is set, may cause
spurious build breakage.

Fixes #737.
include: use x macros for uv_any_{handle,req} unions

Generate the members of the uv_any_handle and uv_any_req unions with
the UV_HANDLE_TYPE_MAP and UV_REQ_TYPE_MAP macros. Eases maintenance
when new handle or request types are added.
unix, windows: nanosecond resolution for uv_fs_[fl]stat

Closes #739.
unix: make uv_timer_init() initialize repeat

uv_timer_get_repeat() should return 0 for timers that haven't been
started.
unix: make timers handle large timeouts

This commit fixes two closely related integer overflow bugs:

* Timers with a timeout > INT_MAX cause uv__next_timeout() to return
  a negative value.

* Timers with very large timeouts (close or equal to ULLONG_MAX) run on
  the next tick.

In both cases, clamp the values to prevent the overflow from happening.

Fixes joyent/node#5101.
Merge remote-tracking branch 'origin/v0.10'
build: add OBJC makefile var

Overrides the Objective-C compiler that is used. Defaults to $(CC).
Prepare for making releases, add uv_version/uv_version_string API
Update AUTHORS and .mailmap
2013.03.25, Version 0.10.2 (Stable)

This is the first officially versioned release of libuv. Starting now
libuv will make releases independently of Node.js.

Changes since Node.js v0.10.0:

* test: add tap output for windows (Timothy J. Fontaine)

* unix: fix uv_tcp_simultaneous_accepts() logic (Ben Noordhuis)

* include: bump UV_VERSION_MINOR (Ben Noordhuis)

* unix: improve uv_guess_handle() implementation (Ben Noordhuis)

* stream: run try_select only for pipes and ttys (Fedor Indutny)

Changes since Node.js v0.10.1:

* build: rename OS to PLATFORM (Ben Noordhuis)

* unix: make uv_timer_init() initialize repeat (Brian Mazza)

* unix: make timers handle large timeouts (Ben Noordhuis)

* build: add OBJC makefile var (Ben Noordhuis)

* Add `uv_version()` and `uv_version_string()` APIs (Bert Belder)
Now working on v0.10.3
include: remove extraneous const from uv_version()

Fixes the following warning:

  include/uv.h:236:30: warning: type qualifiers ignored on function
  return type [-Wignored-qualifiers]
   UV_EXTERN const unsigned int uv_version(void);