more robust handling of empty files upload to s3

This fixes the following case. 
1. Start the upload of a file f of non-zero size to s3 using multipart upload. 
2. The multipart upload is interrupted but not explicitly aborted.
3. The file is cleared so that it is now empty
4. When the upload is retried it will find the parts that have already been transfered which have a non-zero size. This non-zero size is now used to upload the empty file ==>crash

This fix will not use a prexisting part information if the size is zero