Fix several issues from clang's scan-build

  * src/qes_file.h: Small, very rare bugs created if realloc failed.
  * test/test.c: Fix broken CLI parsing bug.
  * test/test_seqfile.c: Fix possible double free on test failure.
Only enable stack-protector on UNIX-like systems

This adds the -fstack-protector flag to cc only if we're on UNIX.
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
Re-write the Cmake config