crypto: make randomBytes/pbkdf2 cbs domain aware

Make the crypto.randomBytes() and crypto.pbkdf2() callback functions
run inside the current domain (if any.)

Fixes #3965.
stream: check _events before _events.error

This fixes the regression introduced by 5458079, which breaks the
net/net-pipe benchmark script.

Closes #6145
Merge remote-tracking branch 'ry/v0.10'

Conflicts:
	AUTHORS
	ChangeLog
	deps/uv/ChangeLog
	deps/uv/include/uv-darwin.h
	deps/uv/src/unix/darwin.c
	deps/uv/src/unix/fsevents.c
	deps/uv/src/version.c
	lib/_stream_writable.js
	src/node_version.h
timer_wrap: Timer.now always update loop time

In `Timer.now` always update the loop time by calling uv_update_time.
Previously we were trying to cache the loop time to prevent extra
syscalls. While a noble goal, it can cause timers to fire early in
certain circumstances. Especially seen in cpu bound work loads or work
loads with synchronous file operations.
pipe_wrap: squelch integer type conversion warning
vm: update API to use options argument

Passing a filename is still supported in place of certain options
arguments, for backward-compatibility, but timeout and display-errors
are not translated since those were undocumented.

Also managed to eliminate an extra stack trace line by not calling
through the `createScript` export.

Added a few message tests to show how `displayErrors` works.
vm: document vm2's changes.

- The caveats no longer apply.
- Document options arguments, including `displayErrors` and the
  different things it means in each place.
- Re-did examples to be more on point, e.g. `runInContext` example
  runs multiple scripts in the same context.
- Documented how `vm.createContext`s meaning has substantially changed,
  and is now more of a "contextifier" than a "creator."
- Reordered vm functions to be readable in order; the concept of
  contextifying needs to come before `runInContext` and
  `runInNewContext`.
- Documented new `vm.isContext`.
- Documented the `vm.Script` constructor, instead of `createScript`,
  since factory methods are silly and we wanted to document the class's
  methods anyway.
- Documented `script.runInContext`.
- Change stability to stable, if I may be so bold.
crypto: make error buffer non-static

Doesn't matter now but it will if/when we have support for multiple
threads.
crypto: remove misleading comment
crypto: make root_cert_store variable extern

Before this commit it was declared static (in a header file!), meaning
it got duplicated in every file that includes it.

A few duplicated pointers is not the end of the world but it introduces
a lot of potential for confusion because root_cert_store in file A is
not the root_cert_store in file B.

Moral of the story: don't declare static variables in header files.
crypto: remove NodeBIO::GetMethod()

Remove NodeBIO::GetMethod() and replace calls to BIO_new() with calls
to the new NodeBIO::New() function.

This commit basically reshuffles some code in order to make it explicit
that the NodeBIO BIO_METHOD is const.
src: remove unused Persistent<FunctionTemplate>
uv: upgrade to v0.11.11
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.