catch EPIPE and exit cleanly

Reported 2013-11-12 to the s3cmd-bugs mailing list.