Fix non-portable zlib compression/decompression code.

This will make 64bit host work.
By getting rid of the "Client cannot receive packet or key is invalid".

Tested on x86_64 arch linux, looking for somebody to test 64bit on
windows and 32bit too for regressions if any.