clean up revamped implementation of download_file

cleanup for https://github.com/hpcugent/easybuild-framework/pull/1066
won't this give an `TypeError: unsupported operand type(s) for //: 'NoneType' and 'int'` on an IOError ?