stream: make finished try to wait for 'close'
Pipeline uses eos which will invoke the callback on 'finish' and 'end' before all streams have been fully destroyed.
Fixes: https://github.com/nodejs/node/issues/32032
Checklist
-
make -j4 test
(UNIX), orvcbuild test
(Windows) passes -
tests and/or benchmarks are included -
documentation is changed or added -
commit message follows commit guidelines