Revisit transfer retry logic in postjob and cmscp.

@bbockelm and @mmascher Can you please have a look at this pull request where I have changed the transfer retry logic? I have added long comments to explain why I decided to do the change I do.
The patch is not yet tested. Once we agree on the retry logic, I will test it and write a comment here in GH that the patch is ready.