Various improvements to code that retries uploads
Various improvements to code that retries uploads

It should retry if there is an error from the server. Also, the retry
counter should now be accurate.

forio/forio-cli,forio/forio-cli,forio/forio-cli