Added preserve_permissions config option to S3 adapter