Prune directories from module search once we've gone two levels
without seeing any modules.