[TIMOB-16672] Fixed serious race condition with downloadFile() as well a...

...s offline error handling and proper error propagation back to the browser.