Fix files being deleted after being uploaded to S3

This bug was introduced attempting to fix CLDCONNECT-796.