try harder to resolve tangles of module re-exports. fixes #6105

Say module A uses module D and others. It will first try to resolve
an identifier using D. If D imports the identifier from A, jl_get_binding_
will return NULL due to a cycle. Before, we considered the identifier
undefined at that point. Now we keep looking in subsequent `using`
modules.

The reason I didn't do this before is that it can cause us to dig deeper
into the using list, and possibly find an identifier that should be
shadowed by other usings. But this is only a problem if the same
identifier is provided by two different usings, which is already ambiguous
and deserves more serious treatment.