Improve namespace packages detection when :confval:`consider_namespace_packages` is enabled, covering more situations (like editable installs).