Add error recovery when elaboration of a type range fails.

If elaboration of the msb or lsb expression in the range of a vector
type specification failed (due to an error in the Verilog code being
compiled), an assertion failure was being triggered when the compiler
attempted to evaluate the expressions. Bypassing the evaluation (and
using a default value) should allow us to recover from the error.
Fix for br961 - function return type elaborated in wrong scope.

The return type of a function should be elaborated in the context of
the enclosing scope, not in the context of the function itself.