Handle zlib's Z_STREAM_END return code, adding support for concatenated gzip files. Fixes #6032.