Fix S3 mock encoding bug

This fixes a bug in our test mock S3 service as reported in https://github.com/GoogleCloudPlatform/gsutil/issues/214 (part of #2437) where we were attempting incorrectly to encode a `bytes` object.

It also adds a new unit test to ensure the new behavior works for both bytes and strings in all supported Python versions. It seems like our `KeyFile` tests are the only place these mocks are used within Boto, so I've added a quick test there that should prevent regressions in the future.

@jamesls, @mfschwartz please take a look.