uv: revert change causing build failures

Revert uv_thread_self() to return unsigned long instead of uv_thread_t.
This was causing a build failure on Windows and is only a temporary fix
until the proper patch lands upstream.

Reverts: https://github.com/joyent/libuv/commit/59658a8
Fixes: ce112c2 "deps: update uv to v1.0.0-rc2"
async-wrap: add functionality, rm tracing module

* Generalize the ASYNC_PROVIDER being passed by the category to which
  it belongs. Instead of having specialized providers for classes like
  ConnectWrap.

* When instantiating a class in cases like receiving an incoming TCP
  connection the activeContext of the parent is no longer available
  because of the asynchronous call. In these cases manually set the
  parent class that contains the context that should propagate to the
  instantiated class.
  * Currently this only happens in tcp_wrap, pipe_wrap and stream_wrap.
    Though careful attention will need to be made in the future that
    other initializations of the same form are also wrapped.

* Force before/after callbacks to run when a class is instantiated, not
  only when a callback is about to be called from MakeCallback.

* Add asyncRemoveQueue() method so handles can disable async_flags_ when
  there are no longer any items in the queue.

* Remove all public facing API for the tracing module and replace with a
  process.binding('async_listener') to initialize hooks into the
  AsyncWrap class.

* Remove flag states of AsyncWrap::ProviderType. It's impossible to have
  and AsyncWrap instance with more than one PROVIDER.

Signed-off-by: Trevor Norris <trev.norris@gmail.com>
async-wrap: macro-ify AsyncWrap::ProviderType's

Making all the provider types a macro expansion allows them to be
declared in one location but used in many places. This makes maintenance
easier as more providers are added.

Signed-off-by: Trevor Norris <trev.norris@gmail.com>
async-wrap: all new instances get a unique id

Every AsyncWrap instance recieves a unique id. A new C++ and JS API have
been exposed to retrieve this value:

* AsyncWrap::id()
* handle.asyncId()

Signed-off-by: Trevor Norris <trev.norris@gmail.com>
node: fn to add undefined prototype properties

Add convenience function to add undefined properties to a
FunctionTemplate's prototype. This is useful when properties will be set
in the future on the instantiated object, without V8 changing the object
map.

Signed-off-by: Trevor Norris <trev.norris@gmail.com>
dgram: SendWrap now has FunctionTemplate

In order for SendWrap to have access to the additional methods in
AsyncWrap, the request object needs to be an instance of a
FunctionTemplate.

Signed-off-by: Trevor Norris <trev.norris@gmail.com>
net: ConnectWrap now has FunctionTemplate

Created classes PipeConnectWrap and TCPConnectWrap so each one could run
AsyncWrap::AddMethods() during instantiation.

Signed-off-by: Trevor Norris <trev.norris@gmail.com>
fs: use FSReqWrap JS object

When instantiating FSReqWrap use a constructed JS object instead of
generating a new object in the C++ API in order to attach the oncomplete
callback.

Signed-off-by: Trevor Norris <trev.norris@gmail.com>
async-wrap: pass id to create callback

Since the object isn't passed to the create callback, pass the id() as
an argument.

Also, switch async_id_ to be a uint32_t instead of a double.
stream_wrap: ShutdownWrap now a FunctionTemplate

Signed-off-by: Trevor Norris <trev.norris@gmail.com>
stream_wrap: WriteWrap now has FunctionTemplate
cares_wrap: now use FunctionTemplate
fs: remove makeCallback

There's no need to run fs callbacks in the global scope now that every
req creates its own object.
async_wrap, src: cleanup

Remove CATCH_RETURN_UNDEF and other minor things.
async_listener, cares_wrap: cleanup
env: simplify async_wrap calls

set_async_wrap_parent_class() is no longer a template method and
reset_async_wrap_parent_class() has been removed.
src: fix domain function casting

In debug mode V8 will fail on a bad cast. So only cast enter/exit if the
Value actually is a Function.
src: remove unnecessary ASSERT's

Since V8 will automatically fail in debug mode if the cast is incorrect
there is no need for us to do so.
fs: fix nullCheck

* Call callback with FSReqWrap object for the function context.
* Make nullCheckSync variant
node: add CHECK to user facing MakeCallback API

In case a user calls node::MakeCallback() and the recv doesn't contain
a callback make sure to always abort.