test: close stream immediately on error

If there is an error in the uv_read_cb, close the uv_stream_t
immediately instead of waiting until the uv_write_cb, and only close the
stream in after_write() if it hasn't been closed already.
unix, windows: uv_now constness

uv_now doesnt require modification of uv_loop_t as such argument is
changed to a const uv_loop_t* as this more in spirit with remaining
API in libuv.
2014.05.02, Version 0.11.25 (Unstable)

Changes since version 0.11.24:

* osx: pass const handle pointer to uv___stream_fd (Chernyshev
  Viacheslav)

* unix, windows: pass const handle ptr to uv_tcp_get*name (Chernyshev
  Viacheslav)

* common: pass const sockaddr ptr to uv_ip*_name (Chernyshev Viacheslav)

* unix, windows: validate flags on uv_udp|tcp_bind (Saúl Ibarra
  Corretgé)

* unix: handle case when addr is not initialized after recvmsg (Saúl
  Ibarra Corretgé)

* unix, windows: uv_now constness (Rasmus Pedersen)
Now working on v0.11.26
thread: add uv_thread_cb typedef

To keep with convention, add a typedef for the function called that
initializes the new thread.

Signed-off-by: Fedor Indutny <fedor@indutny.com>
windows: add VT100 codes ?25l and ?25h
windows: add invert ANSI (7 / 27) emulation
unix: fix handling error on UDP socket creation
unix, windows: remove unneeded define
unix, windows: be consistent when binding implictly in UDP

Only these functions will trigger an implicit binding of a UDP handle:
- uv_udp_send
- uv_udp_recv_start
- uv_udp_set_membership

All other functions will return UV_EBADF in case the socket was not
bound.

Note: currently the socket is created and bound at the same time. This
may change in the future.
unix: fix uv__open_cloexec usage

It returns the fd or the negated errno.
doc: refer to README.md to find out more information about tests

Reason for this change is because 'make test' command does not work.

Signed-off-by: Luka Perkov <luka.perkov@sartura.hr>
process: adjust quote_cmd_arg for empty arguments

adjust quote_cmd_arg so that empty command line
arguments are double quoted instead of skipped
win: minor coding style cleanup
win: open_named_pipe const argument
unix, windows: uv_dlerror const argument
unix, windows: avoid error in uv_fs_event_stop

For consistency with other handle types, if stop is called while the
handle wasn't started yet, it's a no-op.
unix, windows: getnameinfo implementation

Closes #852
heap: fix `heap_remove()`

Remove should shuffle items in both directions, not just down. It is
required, because `max` node could be not the actual maximum value in
the tree.

fix #1267

Signed-off-by: Fedor Indutny <fedor@indutny.com>
windows: remove redundant code in uv_tcp_write

The overlapped structure is reset twice, it is non necessary.

Signed-off-by: Fedor Indutny <fedor@indutny.com>