[5.9] Fix missing indexing data with overloaded type
When you have a type that's ambiguous because it's defined in 2 imported
modules, but you don't have to disambiguate by using the module name,
previously no index references were produced. Now most are for the
common case, but notably nested type constructors and generics still
aren't emitted, partially because of https://github.com/apple/swift/issues/65726
Fixes: https://github.com/apple/swift/issues/64598
(cherry picked from commit e9ff3347782a87350be1a5b7f92795a26abc0871 / https://github.com/apple/swift/pull/65729)