Emit a proper error if modules are multiply-defined.

We were not catching the case when a module has the same name as a
module instance.
Improve the output from cspmchecker in case of an error.