Improve performance of CompressedStreamTools.write and chunk saving - buffer before deflating/gzipping

Signed-off-by: Ross Allan <rallanpcl@gmail.com>