child_process: add path to spawn ENOENT Error

Add a file property to the ENOENT Error returned from ChildProcess's
spawn function.

Signed-off-by: Timothy J Fontaine <tjfontaine@gmail.com>
querystring: custom encode and decode

Not all querystring are utf-8 encoding, make querystring can be used
to encode / decode `non-utf8` encoding string if necessary.

Signed-off-by: Timothy J Fontaine <tjfontaine@gmail.com>
build: disable v8 handle zapping

See also commit e7bfbaf.  Don't depend on deps/v8/build/features.gypi
to disable handle zapping, be explicit about it.

Signed-off-by: Timothy J Fontaine <tjfontaine@gmail.com>
http: Optimize queued client aborts

Avoid sending unsent data and destroying otherwise legitimate sockets
for requests that are aborted while still in the agent queue. This
reduces stress on upstream systems who will likely respond to the
request but client app already knows that it will be dropped on the
floor and also helps avoid killing keep-alive connections.
child_process: don't throw on EMFILE/ENFILE

EMFILE and ENFILE mean 'out of file descriptors'.  It's a run-time error
and as such should emit an error on the child process object, not throw
an exception.

Fixes #7453.

Signed-off-by: Timothy J Fontaine <tjfontaine@gmail.com>
test: fix up pummel/test-net-pingpong

Fix up a bad assumption in pummel/test-net-pingpong, namely that binding
to 'localhost' or '' means that incoming connections will have an IPv4
address.

Signed-off-by: Timothy J Fontaine <tjfontaine@gmail.com>
lint: lib/_http_client.js
src: NODE_UNIXTIME_V8 needs to use an Isolate

Signed-off-by: Timothy J Fontaine <tjfontaine@gmail.com>
smalloc: prevent double free on dispose()

dispose() free's the memory when executed and sets the external array
data to NULL and length to zero.

To prevent the same memory from being free'd twice when the object is
garbage collected we first check if the object's external array data
length == 0. Since alloc() passes NULL to
SetIndexedPropertiesToExternalArrayData() if length == 0 there's no
opportunity for memory leak.
src: kill isolate on exit

Otherwise it's not possible to check from inside a destructor if V8 is
still alive with v8::V8::IsDead().  In V8 3.25, that function returns
true until the last isolate is destroyed.

This used to work in v0.10 and is a standard trick to dispose persistent
handles conditionally.

Signed-off-by: Fedor Indutny <fedor@indutny.com>
smalloc: rework double free bug fix

Rework the fix from commit 6810132 in a way that removes ~60 lines of
code.

The bug was introduced in commit e87ceb2 (mea culpa) and is at its core
a pointer aliasing bug where sometimes two independent pointers existed
that pointed to the same chunk of heap memory.

Signed-off-by: Trevor Norris <trev.norris@gmail.com>