test: fix flaky test-tls-socket-close
Replace timer/timeout race with event-based ordering, eliminating test flakiness.
Fixes: https://github.com/nodejs/node/issues/11912
Checklist
-
make -j4 test
(UNIX), orvcbuild test
(Windows) passes -
commit message follows [commit guidelines][]
Affected core subsystem(s)
test tls