validation BUGFIX avoid duplicit nodes in unres

It could occur for default values that have their
own unres handling. This one is no longer used and
they are normally validated during subtree validation.
diff --git a/src/validation.c b/src/validation.c
index 4ea4730..95062f7 100644
--- a/src/validation.c
+++ b/src/validation.c
@@ -1030,32 +1030,28 @@
     struct lyd_node *node;
 
     LYD_TREE_DFS_BEGIN(root, node) {
-        /* skip added default nodes */
-        if ((node->flags & (LYD_DEFAULT | LYD_NEW)) != (LYD_DEFAULT | LYD_NEW)) {
-            LY_LIST_FOR(node->meta, meta) {
-                if (((struct lyext_metadata *)meta->annotation->data)->type->plugin->validate) {
-                    /* metadata type resolution */
-                    LY_CHECK_RET(ly_set_add(type_meta_check, (void *)meta, 1, NULL));
-                }
+        LY_LIST_FOR(node->meta, meta) {
+            if (((struct lyext_metadata *)meta->annotation->data)->type->plugin->validate) {
+                /* metadata type resolution */
+                LY_CHECK_RET(ly_set_add(type_meta_check, (void *)meta, 1, NULL));
             }
+        }
 
-            if ((node->schema->nodetype & LYD_NODE_TERM) && ((struct lysc_node_leaf *)node->schema)->type->plugin->validate) {
-                /* node type resolution */
-                LY_CHECK_RET(ly_set_add(type_check, (void *)node, 1, NULL));
-            } else if (node->schema->nodetype & LYD_NODE_INNER) {
-                /* new node validation, autodelete */
-                LY_CHECK_RET(lyd_validate_new(lyd_node_children_p((struct lyd_node *)node), node->schema, NULL, diff));
+        if ((node->schema->nodetype & LYD_NODE_TERM) && ((struct lysc_node_leaf *)node->schema)->type->plugin->validate) {
+            /* node type resolution */
+            LY_CHECK_RET(ly_set_add(type_check, (void *)node, 1, NULL));
+        } else if (node->schema->nodetype & LYD_NODE_INNER) {
+            /* new node validation, autodelete */
+            LY_CHECK_RET(lyd_validate_new(lyd_node_children_p((struct lyd_node *)node), node->schema, NULL, diff));
 
-                /* add nested defaults */
-                LY_CHECK_RET(lyd_new_implicit_r(node, lyd_node_children_p((struct lyd_node *)node), NULL, NULL, type_check,
-                        when_check, val_opts & LYD_VALIDATE_NO_STATE ? LYD_IMPLICIT_NO_STATE : 0,
-                        diff));
-            }
+            /* add nested defaults */
+            LY_CHECK_RET(lyd_new_implicit_r(node, lyd_node_children_p((struct lyd_node *)node), NULL, NULL, type_check,
+                    when_check, val_opts & LYD_VALIDATE_NO_STATE ? LYD_IMPLICIT_NO_STATE : 0, diff));
+        }
 
-            if (!(node->schema->nodetype & (LYS_RPC | LYS_ACTION | LYS_NOTIF)) && node->schema->when) {
-                /* when evaluation */
-                LY_CHECK_RET(ly_set_add(when_check, (void *)node, 1, NULL));
-            }
+        if (!(node->schema->nodetype & (LYS_RPC | LYS_ACTION | LYS_NOTIF)) && node->schema->when) {
+            /* when evaluation */
+            LY_CHECK_RET(ly_set_add(when_check, (void *)node, 1, NULL));
         }
 
         LYD_TREE_DFS_END(root, node);
@@ -1111,8 +1107,8 @@
         ret = lyd_validate_new(first2, NULL, mod, diff);
         LY_CHECK_GOTO(ret, cleanup);
 
-        /* add all top-level defaults for this module */
-        ret = lyd_new_implicit_r(NULL, first2, NULL, mod, &type_check, &when_check, val_opts & LYD_VALIDATE_NO_STATE ?
+        /* add all top-level defaults for this module, do not add into unres sets, will occur in the next step */
+        ret = lyd_new_implicit_r(NULL, first2, NULL, mod, NULL, NULL, val_opts & LYD_VALIDATE_NO_STATE ?
                 LYD_IMPLICIT_NO_STATE : 0, diff);
         LY_CHECK_GOTO(ret, cleanup);