DuettoBackend: Fix infinite loop when computing global dependencies