Fix issue detected by UMLCanvasObject unit test
Iterating through a QList using index fails if contained objects are removed during this time.
CCBUG:414044