zlib: fix decompression of empty data streams
add4b0ab made the assumption that compressed data would never lead to an empty decompressed stream.
Fix that by explicitly checking the number of read bytes.
Fixes: https://github.com/nodejs/node/issues/17041 Refs: https://github.com/nodejs/node/pull/13322
Checklist
-
make -j4 test
(UNIX), orvcbuild test
(Windows) passes -
tests and/or benchmarks are included -
commit message follows commit guidelines
Affected core subsystem(s)
zlib