ModuleWithDependentsScope: walk dependency graph more carefully with respect to exported dependencies
(cherry picked from commit 9400b89)