Record each kind of error when reading in files.

compiler/prog_io_error.m:
    Replace the enum that used to record only whether we found no errors,
    some nonfatal errors or some fatal errors, with a type that records
    just what kinds of errors we found. Document each kind of error.

compiler/prog_io.m:
    Record any errors using the new type. In some cases, we used to
    forget fatal errors after finding nonfatal ones; now we don't.

compiler/read_modules.m:
    Do not generate error messages about not being able to open a file
    if we *could* open the file, but found other fatal errors inside it.

    Factor out some common code.

compiler/intermod.m:
    Ignore the error of not being able to open .opt files, but do not
    ignore any other errors inside them. This fixes a long-standing piece
    of strange-looking code.

compiler/module_imports.m:
    Do not ignore old fatal errors if reading a new interface file
    gets some new nonfatal errors. This fixes a long-standing XXX.

compiler/write_module_interface_files.m:
    Do not ignore fatal errors when considering whether to write out interface
    files. This fixes a long-standing XXX.

compiler/modules.m:
    Generate better error messages for fatal errors inside modules
    other than not being able to open the module.

compiler/deps_map.m:
compiler/make.module_dep_file.m:
compiler/mercury_compile.m:
compiler/module_deps_graph.m:
compiler/recompilation.check.m:
compiler/trans_opt.m:
compiler/write_deps_file.m:
    Conform to the change in prog_io_error.m.