stream: fix stream.finished on Duplex
finished would incorrectly believe that a Duplex is already closed if either the readable or writable side has completed.
Fixes: https://github.com/nodejs/node/issues/33130
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