zlib: Fix zero-length buffer assertion error

cc @mikeal