test: wait for stream close before writing to file
Wait for async operations on a file to finish before writing to it again.
This fixes flakiness in parallel/test-readline-async-iterators-destroy.
Fixes: https://github.com/nodejs/node/issues/30660
Checklist
-
make -j4 test
(UNIX), orvcbuild test
(Windows) passes -
tests and/or benchmarks are included -
commit message follows commit guidelines