osx: Fix a possible segfault in uv__io_poll

In our build infrastructure, I've seen a lot of segfaults recently that
were all only happening on OSX. Upon inspecting the coredumps, it
appearded that all segfaults happened at the same instruction, and upon
translating the assembly back to the source, I found that an array could
be indexed with a -1 index before the index was checked to be not -1.

As concrete evidence, here is the situation that I found caused the
segfault.  The instruction in question along with the relevant register
values was:

    mov    (%r8,%r15,8),%r12

    r8  = 0x7fb0ba800000
    r15 = 0xffffffffffffffff

    r8 + r15 * 8 == 0x7fb0ba7ffff8

It appears that the base of loop->watchers was page aligned, and by
going back one word I guess that the page wasn't mapped, causing our
segfaults.
2014.01.08, Version 0.10.22 (Stable)

Changes since version 0.10.21:

* windows: avoid assertion failure when pipe server is closed (Bert
  Belder)
Now working on v0.10.23
linux: relax assumption on /proc/stat parsing

CPU entries in /proc/stat are not guaranteed to be monotonically
increasing, asserting on this assumption can break in cases such
as the UltraSparc II machine shown in #1080.

Signed-off-by: Luca Bruno <lucab@debian.org>
openbsd: fix obvious bug in uv_cpu_info

`int which[]` should not be static here, as the function itself is
changing it

fix joyent/node#6878
process: close stdio after dup2'ing it

Thus allow passing the same file descriptor as the source of multiple
stdios.

Committed with the help and code parts from:

  * Sam Roberts <sam@strongloop.com>

fix #1074
Merge branch 'v0.10'

Conflicts:
	ChangeLog
	src/unix/process.c
	src/version.c