compress/zlib: fix error handling