stream: destroy wrapped streams on error
Stream should be destroyed and update state accordingly when the wrapped stream emits error.
Does some additional cleanup with future TODOs that might be worth looking into.
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