base: Fix AMD dependency loader bug to do with circular deps

Our AMD loader would find circular dependencies when there were
none.