Fixed #23556 -- Raise a more meaningful error message when migrations refer to an unavailable node

https://code.djangoproject.com/ticket/23556
This worries me a bit - are we really sure there is no other possible reason for `KeyError` to be raised within `add_dependency`?

Maybe if we want this improved error it means that `add_dependency` should raise a more specific error than `KeyError` in the case of a missing migration (ideally even with args specifically identifying which one was missing), so we can catch something more specific here?