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>