Keep the deflate buffer from ballooning up

Let's not make the size grow larger regardless of how much we're actually using. It does not go well when we re-use the buffer and asize is large enough.

Includes a fix for uninitialised memory that valgrind told me about while checking this out.