Test downloaded file for corruption and retry 5 times

These changes should fix #102.  
The result of the function is the same as the result of the last execution.  If the tar file exist with an error, then the function exits with an error.  If the function exits with an error, then the download will be re-tried, assuming there are more retries left.