fs: refactor autoClose
Simplify autoClose logic into a helper. Also pass error through destroy instead of emitting when possible. Making act more like a "proper" stream in terms of destroy
.
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