validation BUGFIX keep order of node_when nodes

Fixes sysrepo/sysrepo#2664
diff --git a/src/validation.c b/src/validation.c
index a6c9fdd..9e365b6 100644
--- a/src/validation.c
+++ b/src/validation.c
@@ -241,8 +241,8 @@
                 node->flags |= LYD_WHEN_TRUE;
             }
 
-            /* remove this node from the set, its when was resolved */
-            ly_set_rm_index(node_when, i, NULL);
+            /* remove this node from the set keeping the order, its when was resolved */
+            ly_set_rm_index_ordered(node_when, i, NULL);
         } else if (ret != LY_EINCOMPLETE) {
             /* error */
             goto error;