Add S3 retry

This adds configurable retry for S3.