test: fix flaky test-preload
Checklist
-
tests and code linting passes -
the commit message follows commit guidelines
Affected core subsystem(s)
test
Description of change
Use close
event rather than exit
event to make sure all output has
been received before checking assertions.
Fixes: https://github.com/nodejs/node/issues/6722
/cc @Fishrock123 @mhdawson h/t @santigimeno