[PLAT-3264] Perform dependency node target collapsing outside of graph building lock.