Fixed crash when s3 bucket did not exist for put operation

As per the comment in https://github.com/ansible/ansible/pull/4426 please find attached a pull request that prevents a crash occuring when the s3 bucket does not exist for a put operation.