Fix issue #20 (gzip encoding)

Now detect when gzip is actually being used via magic number instead of
taking the server's word for it.
Make test_resultset_independence more reliable

...as far as the particular bug it is exercising is concerned.