zlib: handle dictionary errors graciously

See #4632.

Suggested reviewers: @indutny @isaacs