Properly close the WriteFlusher instance

Fixes #566. Awesome work finding this @klauspost!