set CHANGE make ly_set* functions return LY_ERR values

unify ly_set* function that were returning -1 as error indicator
combined with positive value indicating index inside the set. The most
of other libyang functions return LY_ERR to indicate result. The problem
of these functions was also the limited range of the returned index.
While internally index is uint32_t, it was limited only to a positive
part of int type.
diff --git a/src/tree_data_helpers.c b/src/tree_data_helpers.c
index 86b0c64..905eadc 100644
--- a/src/tree_data_helpers.c
+++ b/src/tree_data_helpers.c
@@ -209,7 +209,7 @@
             node->flags |= LYD_WHEN_TRUE;
         } else {
             /* remember we need to evaluate this node's when */
-            ly_set_add(when_check, node, LY_SET_OPT_USEASLIST);
+            LY_CHECK_RET(ly_set_add(when_check, node, LY_SET_OPT_USEASLIST, NULL), );
         }
     }