Adjust `is_namespace()` to check `ModuleSpec.loader` (#2410)

This fixes inference when six.moves is imported.

Closes #2409
3 files changed