Correct handling of Z_BUF_ERROR, test for it.

"index.html.gz" is a file which trips a Z_BUF_ERROR on being
gunzipped.