Do not use the file name in errors unless it exists

Fixes #1182
I can not add a test for this, as the only place this happens is an invalid encoding on cscript. we do not run tests on specific engines, and this would have an engine specific behavior.
The issue is we catch the failure to read exception in tsc.ts, then augment it with the reason for failure, "unsupported encoding", then raise an error, using the on error message. if the file is one that is a root file, there is no refFile, and then we assert when we call createFileDiagnostics.