AST: Fix accessibility checking in opaque type archetype substitution logic
We were failing to replace opaque types with their underlying type
upon encountering an internal type from the current module. This
could happen when the internal type appeared in generic substitutions,
for example when calling a protocol extension method.
Fixes <rdar://problem/60951353>.