Added retry mechanism for S3 connection errors

Closes #95
It seems that timeout-related error always have code 400. I think we can extend it when if we see other errors like this.