src: close libuv handles on exit

Commit 556b890 added a call to uv_loop_delete() with the intent of
catching handle lifecycle bugs.  It worked because it exposed one:

    process.on('exit', function() {
      console.log('bye');  // Asserts.
    });

When run, it asserts with the following message:

    Assertion failed: (!uv__has_active_reqs(loop)), function
    uv__loop_delete, file ../deps/uv/src/unix/loop.c, line 150.

That's because libuv as of joyent/libuv@3f2d4d5 checks that there are
no in-flight requests when the event loop is destroyed.  In the test
case above, the write request for the string hasn't completed yet by
the time node.js exits: the string itself has most likely been written
but libuv hasn't had the opportunity to return the write request to
node.js.

That's why this commit adds a cleanup step right before exit where it
explicitly closes all open handles, then waits until the event loop
exits naturally.

Named pipes (UNIX domain sockets) are shut down first in order to flush
pending write requests.  Should go some way towards fixing the Windows
issue where output on stdout/stderr sometimes gets truncated.

Fixes joyent/libuv#911.
test: move smalloc segfault tests to pummel

These tests take a while to complete, and the issue only potentially
appears under heavy load.
Revert "src: close libuv handles on exit"

This change is not entirely ready for prime time: it's making ~50 tests
fail on Windows, mostly due to timeouts.  It's up for debate who is
at fault here: node.js or libuv.

It does however expose a libuv bug on OS X, where the event loop
sometimes gets stuck in uv__io_poll() when there is a single
UV_SHUTDOWN request left in the queue.  Needs further investigation.

This reverts commit 4915884da69814bd4daab22393919a628c9ecf23.
Revert "src: call uv_loop_delete() on exit in debug mode"

Don't call uv_loop_delete() until we've figured out a way to gracefully
close open handles.  See also commit 4915884 and its subsequent revert
in commit 980cbd5.

This reverts commit 556b890ad91780c52c77dccaddcf69beb8184e27.
benchmark: Support passing v8 flags to benchmarks

The better to test --use-strict effects on performance.

(Spoiler: it has no measurable effect on performance.)
Merge remote-tracking branch 'ry/v0.10'
benchmark: Fix execArgv handling

Bug in 01f3b46 causes the same benchmark to be run repeatedly.

Not so useful for the compare scripts.
Merge remote-tracking branch 'ry/v0.10'
test: speed up simple/test-fs-watch

Don't wait a full second before starting the watcher, 10 ms ought to be
more than enough time.  Reduces running time from 1250 ms to 250 ms on
my system.
test: don't use --max-stack-size=0

--max-stack-size was removed in 3a87b31, use --stack-size instead.
What's more, a zero length stack will likely crash the process.
src: clean up CLI argument parser

* Exit with an error message when the option is not a node or V8 option.

* Remove the option_end_index global.  Needs to happen anyway for
  the multi-context work, might as well land it in master now.

* Add a smidgen of const-correctness.

* Pay off a few years of accrued technical debt.
uv: upgrade to v0.11.12

* upgrade deps/uv/ to v0.11.12.
* update files in src/ after a libuv API change.
src: Remove outdated comment re assert()

It's a normal function now, not a macro.
process: Add internal _rawDebug() method

This is useful when we need to push some debugging messages out to
stderr, without going through the Writable class, or triggering any kind
of nextTick or callback behavior.
string_bytes: use extern for length and write utf8

If the string is external then the length can be quickly retrieved. This
is especially faster for large strings that are being treated as UTF8.
Also, if the string is external then there's no need for a full
String::WriteUtf8 operation. A simple memcpy will do.