tree data BUGFIX non-changing iterator (#2207)

Signed-off-by: Amjad Daraiseh <adaraiseh@okdanetworks.com>
diff --git a/src/tree_data_new.c b/src/tree_data_new.c
index f4a5eaa..f3bd9e7 100644
--- a/src/tree_data_new.c
+++ b/src/tree_data_new.c
@@ -802,6 +802,7 @@
         rc = lyd_create_term(key_s, key_val, key_len, 0, store_only, NULL, format, NULL, LYD_HINT_DATA, NULL, &key);
         LY_CHECK_GOTO(rc, cleanup);
         lyd_insert_node(ret, NULL, key, LYD_INSERT_NODE_LAST);
+        ++i;
     }
 
     if (parent) {