Windows: add uv_msafd_poll, to support overlapped socket polling
linux: fix build error with old kernel headers

O_CLOEXEC was introduced in linux 2.6.23, don't assume it's available.

Fixes #400.
Unix: namespace stream handle flags
Api for polling external sockets
Windows: implement uv_poll
Unix: implement uv_poll
Test: add tests for uv_poll
Benchmarks: add size of uv_poll_t to benchmark-sizes
Rename uv_platform_socket_t to uv_os_sock_t
Merge branch 'poll'

Closes: #316, #401
Ref: #265, #349
unix: change uv_dl*() error code

Return UV_ENOENT instead of UV_EINVAL. UV_EINVAL was arbitrarily chosen and
turns out to be inconsistent with the Windows implementation.

Fixes #395.
unix, win: rework uv_dlopen() API
unix: don't use setlocale()

setlocale() is not inherently thread-safe. We'll have to live with the fact
that test/test-dlerror.c fails on systems with localized error messages.
windows: remove unused variables
unix: zero out new loop struct

Fixes spurious segfaults in pyuv.
Tests: make test-tcp-write-error pass on XP
Windows: fix iocp emulation bugs for tcp handles

Makes ipc_tcp_connection pass on Windows XP
Windows: skip GetFileAttributes call when opening a file

It wasn't working, and everything seemed to work fine nonetheless. Removing it just saves a syscall.
Windows: fix MinGW

MinGW's headers are missing a definition for SIO_BASE_HANDLE
sunos: make fs.watch scale better

Instead of using one port per watch, use one port for all the watches.
This is a cherry-pick of commit 7326962 from v0.6 into master.

Conflicts:

	include/uv-private/uv-unix.h
	src/unix/core.c
	src/unix/sunos.c