Support older versions of zlib

we manually check for the new function gzbuffer, which is the only
reason we needed the newer versions of the library
Add initial version of qes_error.[ch]

Initial error handling functions