Fix string parameter handling in S3Connection.

Same code as #1952, but with an added unit test. Test fails before the fix and passes afterward.

@toastdriven please review