Make sure GZIP header is written even if nothing was written

Motivation:

JdkZlibEncoder does not generate a GZIP header when a user does not write anything at all, ending up with a 10-byte footer only.

Modification:

Modify finishEncode() method to write the GZIP header if it was not written before.

Result:

Encoding 0-byte content result in 20-byte GZIP stream now.