tracing: Fix some race conditions
This PR contains two commits that fix some race conditions that were causing flakiness on https://github.com/nodejs/node/issues/21038. There may yet be more races, but this is what I got right now.
One of the commits is an upstream V8 fix. I didn't bother requesting an upstream back-port as it is not particular useful for Chrome and better to float here.
Checklist
-
make -j4 test
(UNIX), orvcbuild test
(Windows) passes -
commit message follows commit guidelines