Check for bad xml nodes in update cycles
Sometimes in Layers and Objects dialog we will get signals about changes which appear to have come from the document but which cause confusion because they are merges and then undos. This requires some more careful checking to avoid these situations.
Fixes #4164 (closed)