Move HTTP 400 handling from send_request() into a helper function

By moving the HTTP 400 error handling path to its own function, we
simplify send_request() quite a lot, and gives us a place to try to do
sane error handling.

This patch implements retry logic for three classes of HTTP 400 error
seen to date:

1) Invalid signature method.  Attempting to use signature v2 on an
endpoint that only supports signature v4 must retry using signature
v4.

2) Invalid signature method.  Attempting to use a signature v4 on an
endpoint that only supports signature v2 (e.g. DreamObjects) should
fall back to retrying the request with V2.

3) Invalid region in v4 signature.  If you somehow get the wrong
region into the signature (e.g. --region=eu-west-1, bucket
s3://eu-central-1.example.com), AWS tells you the correct region to
use.  Retry with the correct region.

By using a helper function, we will be able to reduce duplicate code
in send_file() and recv_file().
Use HTTP 400 handler in send_file()

Now that we have a generic handler, use it.
Use HTTP 400 error handler in recv_file()

The common HTTP 400 error handler can be used in recv_file() also. In
this case, DreamObjects doesn't return a payload
(e.g. response['data']), so we have to catch it outside the test for a
'data' field.
Add http 403 handler for eucalyptus response to signature v4

Eucalyptus walrus doesn't yet support signature v4, it rejects the
request with an HTTP 403.

This patch adds a 403 handler for exactly this returned message, and
reissues the call using signature v2.

N.B. I haven't tested this as I don't have an instance of Walrus
available to me at the moment.
sort x-amz-* headers before signing them

per
http://docs.aws.amazon.com/AmazonS3/latest/dev/RESTAuthentication.html#ConstructingTheAuthenticationHeader
the x-amz-* headers need to be sorted before signing.