more compatibility fixes for s3cmd

s3cmd uses virtual hostname for bucket name, with the host header
including the port. need to strip out the port to find out the
bucket name

also includes a small fix for x-amz-date, according to the
documentation we should always use empty string for date
when x-amz-date is included