Close the file uploaded to s3.
Merge remote-tracking branch 'upstream/master' into expose_stream

* upstream/master:
  Close the file uploaded to s3.