Fix `config.transfer_nested_constants = true`.

We shouldn’t give users an error when they stub
a constant that is not a class or module.

Fixes #677.