Test downloaded file for corruption and retry 5 times

These changes should fix #102