warnings: Find out if a qualified name is in the interactive scope directly
There were two ad-hoc mechanisms used to determine which modules were in the interactive scope.
- Look at everything in the GRE, to see what is imported qualified.
- Look at the last loaded module in the HPT.
(1) Is very inefficient, GlobalRdrEnvs can be very big. (2) is incorrect, there is no reason to assume the "last" thing added to the HPT has any relevance to module loading order.
Happily, the same checks can be implemented directly by looking at the interactive imports from the interactive context. This mirrors what happens for normal imports.
See #14225 (closed) and #15611 (closed)