Do not swallow exception on NameError within constant.

Fixes https://github.com/rails/rails/issues/9933.
any reason to use `>` and not `!=` ?