windows: fix application crashed popup in debug version

This is a backport of 2 patches by Ting-Yu Lin and Hiroaki Nakamura.
windows: fix handle leak in uv_fs_utime
win: fix compilation with MSVCRT < 8.0
linux: update comm field in uv_set_process_title()

Makes the new process name visible in both `ps` and `ps a`, with the caveat
that `ps` will only print the first 16 characters.

Before this commit, `ps` kept reporting the old process name.
Revert "unix: avoid iterating over all async handles"

This reverts commit 209abbab27abdc63200cbd707f72fed4245ab4d0.

Fixes the following SIGSEGV:

  (gdb) f 1
  #1  0x00007fc084683aec in uv__async_io (loop=0x7fc0848e0b40,
  handle=0x7fc0848e0c78, events=1) at src/unix/async.c:175
  175             ASYNC_CB(h)
  (gdb) list
  170
  171         /* If we need to sweep all handles anyway - skip this loop */
  172         if (!loop->async_sweep_needed) {
  173           for (i = 0; i < end; i += sizeof(h)) {
  174             h = *((uv_async_t**) (buf + i));
  175             ASYNC_CB(h)
  176           }
  177         }
  178
  179         bytes -= end;
  (gdb) print *h
  $1 = {close_cb = 0x184e1b0, data = 0x18d9520, loop = 0x7fc0848e0b40,
  type = 49, handle_queue = {prev = 0x18dae10, next = 0x7860c0}, flags = 32,
  next_closing = 0x1863b40, pending = 0, async_cb = 0x31,
  queue = {prev = 0x18dae50, next = 0x7860c0}}
  (gdb)

It looks like the async handle gets closed or otherwise becomes invalid before
the sweep is executed.

Fixes #603.
unix: reopen tty as /dev/tty

Reopen the file descriptor when it refers to a tty. This lets us put the tty in
non-blocking mode without affecting other processes that share it with us.

Fixes #601.
benchmark: timed_udp_pummel should not write to closed udp handle

This fixes intermittent assertion failures when running the benchmark.
benchmark: async_pummel should not call uv_async_send on closed handle

This fixes an assertion that triggered in debug builds on Windows.
include: fix ngx_queue_foreach() macro

Guard against the possibility that the queue is emptied while we're iterating
over it. Simple test case:

  #include "ngx-queue.h"
  #include <assert.h>

  int main(void) {
    ngx_queue_t h;
    ngx_queue_t v[2];
    ngx_queue_t* q;
    unsigned n = 0;
    ngx_queue_init(&h);
    ngx_queue_insert_tail(&h, v + 0);
    ngx_queue_insert_tail(&h, v + 1);
    ngx_queue_foreach(q, &h) {
      ngx_queue_remove(v + 0);
      ngx_queue_remove(v + 1);
      n++;
    }
    assert(n == 1); // *not* 2
    return 0;
  }

Fixes #605.
Merge branch 'v0.8'
unix: fix ‘fd’ undeclared build error

Reapplies commit b5028c5b, failed to merge in 5cb4197.
windows: closing handles should always keep the loop alive

This makes the tcp-ref2 and udp-ref2 tests pass again.
Also adds another reference count test.
darwin: make it possible to compile for iOS

Relocate the include of TargetConditionals.h and fixe the use of
TARGET_OS_IPHONE. Furthermore, uv__fsevents_init() and uv__fsevents_close are
now empty functions for iOS, since the FSEvents API is not available there.
unix, windows: fix EAGAIN error message
unix, windows: fix several error messages
unix: rewrite inner poll logic
unix: remove libev
linux: latched watchers experiment
merge fixups
unix: add READ_ONCE() macro

Forces a volatile read of the target variable.