[v8.x backport] Backport tsfn to v8.x
Checklist
-
make -j4 test
(UNIX), orvcbuild test
(Windows) passes -
tests and/or benchmarks are included -
documentation is changed or added -
commit message follows commit guidelines
Backporting ThreadSafeFunction
to v8.x completes its availability across all LTS release lines. This will, in turn, allow us to mark it as stable and thereby bump the available N-API version to 4.