Handle early finalization of TSFN by Node.js
Handle early finalization of TSFN by Node.js

Thread-safe functions can get released early by Node.js itself during
the teardown of the Environment that holds them. When this happens -
`finalize_cb` of the thread-safe function is invoked to notify us. This
change makes us remember if the thread-safe function was finalized
before we got into the `Drop` implementation for it so that we don't
deallocate it twice.

Additionally, we should not invoke `call_threadsafe_function` after
either `finalize_cb` call or `napi_closing` return value from previous
`call_threadsafe_function`. Handle this by holding a mutex around the
call, which doesn't introduce any additional locking because
`call_threadsafe_function` itself holds another mutex while active.

neon-bindings/neon,neon-bindings/neon,neon-bindings/neon,neon-bindings/neon