Fix unicode error in URI paths

If a key name is provided that is unicode we need to encode the path
components before sending it to quote().

This was noticed during the high level s3 integration in the AWS CLI.

cc @garnaat @kyleknap