Make dependencies.rb add a name to NameError

In order to use `.name` on #15762, we need to be consistent and set it when we raise a `NameError` on `Dependencies` module.
review @tenderlove @matthewd @fxn