LPS-49245 - Please try to revise the Amazon S3 code to prevent possible deadlocks

besides the basic change,i have added a new line " newS3Object.closeDataInputStream();" to the method of    updateFile(long,long,long,String)