diagram_plus: Added more guards to protect against bad routes config.
Some times, in case of bad configuration of nodes and routs, diagram could hang with 100% CPU usage. With this commit, we add more guards added to limit max iterations to 20000 for possibly infinite loops