clean up revamped implementation of download_file

cleanup for https://github.com/hpcugent/easybuild-framework/pull/1066
you should probably make sure this is inside a directory you control (so the data dir in the tests?), because I could have a file `/nosuchfile` on my system.