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