Porting HADOOP-3733 to Hadoop 2.6.0. Also modifying the new S3A implementation