[aws] Fix multi-part upload and optimize AWS code

This fixes a signing bug in multi-part upload for AWS, as well as incorporates @indutny's AWS optimization.