stream: fix finished writable/readable state
writable/readable does not indicate whether as stream is a Writable/Readable. This implements a better check for whether a object is a Writable/Readable.
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