[Bam.Core] Avoid ending up in an infinite loop, iterating over dependencies, with post action nodes, to determine whether dependencies need to move