[async_wrap] backport of gc abort on destroy() fix on v6.x
Checklist
-
make -j8 test
(UNIX), orvcbuild test nosign
(Windows) passes -
commit message follows commit guidelines
Affected core subsystem(s)
async_wrap
Description of change
This is a backport of 517e3a64, cf5f4b85 and b49b496a to v6.x
This is semi-urgent. In the issues listed as Fixed
in the commit shows the process is aborting in v6. So we can weight the urgency of landing this vs the possible regression it may introduce. Note that there could only be a regression if the user is using process.binding('async_wrap')
. Otherwise all the changed logic is skipped.