Added tests for compress=true and fixed orderly closing of the streams.

14 jobs for add-raw-upload-api-v0.11.0 in 26 minutes and 21 seconds (queued for 2 seconds)