Fix NPE for s3.putObject with files using code from aws-java-sdk.