build: use same CFLAGS in autotools build as in gyp

Closes #1362
unix, windows: add uv_fileno

Returns the platform specific file descriptor for handles that are
backed by one. The datatype is abstracted as uv_os_fd_t, which maps to
int on Unices and HANDLE on Windows.

Users can use this function to set specific socket options, for example,
in a non portable way.

This function is essentially a shotgun, you better be careful with
whatever you do with it, don't blame me if you used it to get the fd of
a stream, close it yourself and expect things to Just Work.
windows: make sure sockets and handles are reset on close

Set the socket to INVALID_SOCKET foir TCP and UDP handles and
the handle to INVALID_HANDLE_VALUE on TTY handles after closing them.
windows: fix buffer leak after failed udp send

Fixes #1426

Signed-off-by: Saúl Ibarra Corretgé <saghul@gmail.com>
core: update version to 1.0.0
doc: update README with versioning information
core: add a reserved field to uv_handle_t and uv_req_t

Just in case we need to work hard in keeping ABI compatibility.
windows: remove duplicated field

Fixes build
unix: simplify how process handle queue is managed
unix: stop child process watcher after last one exits
test: use less requests on tcp-write-queue-order

Makes the test reliably pass on Windows, otherwise the runtime aborts.
windows: simplify code in uv_timer_again

Remove duplicated code by directly calling uv_timer_stop
unix, windows: don't allow a NULL callback on timers
darwin: allocate enough space for select() hack

`fd_set`s are way too small for `select()` hack when stream's fd is
bigger than 1023. Make `fd_set`s a part of `uv__stream_select_t`
structure.

fix #1461
gyp: remove UNLIMITED_SELECT from dependent define

It isn't really needed here.
windows: further simplify the code for timers

- Remove the UV_HANDLE_ACTIVE flag. It's a duplicate from
  UV__HANDLE_ACTIVE, which was used solely on timers and loop watchers.

- Avoid duplicated code when running timers by stopping the handle and
  rearming it with the repeat time, thus having a single place where the
  timers are added and removed to and from the RB tree, respectively.
test: don't close connection on write error

The echo server shouldn't close the connection when there's an error on
write. Instead simply echo the error message and allow the other side to
close the connection.

Also do a partial revert of 4d905fb where after_shutdown was removed.

Fixes: 4d905fb "test: close stream immediately on error"
Signed-off-by: Trevor Norris <trev.norris@gmail.com>
Signed-off-by: Saúl Ibarra Corretgé <saghul@gmail.com>
doc: add API documentation
doc: mention API documentation in README
include: cleanup uv.h

Remove comments describing the API which are now part of the
documentation, thus avoiding future comment rot (and removing the
existing part).