Retry upload after a broken pipe