uidesigner: Fixes crash when deleting widgets with children.