Do not swallow exception on NameError within constant.

Fixes https://github.com/rails/rails/issues/9933.
@tgxworld I think I'd add a comment explaining the case where we want to raise a `NameError`.