Fix error with deleting an open file in s3.Key.get_contents_to_filename. Patch by nmerket on Github.
Merge branch 's3-fix' into develop. Makes sure file is closed before attempting to delete it when downloading an S3 key. Fixes #1791.