zlib: fix a misuse of ferror