zpipe: inflate/deflate using zlib

This is a sample from zlib.net:

http://www.zlib.net/zpipe.c

It's compiled against the system zlib.