zlib: allow zero values for level and strategy

This is a back-port of commit c9644fb from the master branch.
zlib: level can be negative

This is a back-port of commit e945903 from the master branch.