schema CHANGE remove private_destructor parameter from ly_ctx_destroy()

The mechanism was not reliable and not used often. libyang provide
function to traverse the schema and free the set data manually or the
caller can maintain some information to free the set data directly.

This commit changes API.
diff --git a/tests/utests/schema/test_parser_yang.c b/tests/utests/schema/test_parser_yang.c
index a67deed..5f29c27 100644
--- a/tests/utests/schema/test_parser_yang.c
+++ b/tests/utests/schema/test_parser_yang.c
@@ -100,7 +100,7 @@
 static int
 teardown(void **state)
 {
-    lys_module_free(YCTX->parsed_mod->mod, NULL);
+    lys_module_free(YCTX->parsed_mod->mod);
     LOG_LOCBACK(0, 0, 0, 1);
 
     free(YCTX);
@@ -546,7 +546,7 @@
 {
     struct ly_ctx *ly_ctx = ctx->parsed_mod->mod->ctx;
 
-    lys_module_free(ctx->parsed_mod->mod, NULL);
+    lys_module_free(ctx->parsed_mod->mod);
     ctx->parsed_mod = calloc(1, sizeof *ctx->parsed_mod);
     ctx->parsed_mod->mod = calloc(1, sizeof *ctx->parsed_mod->mod);
     ctx->parsed_mod->mod->parsed = ctx->parsed_mod;
@@ -562,7 +562,7 @@
 {
     struct ly_ctx *ly_ctx = ctx->parsed_mod->mod->ctx;
 
-    lys_module_free(ctx->parsed_mod->mod, NULL);
+    lys_module_free(ctx->parsed_mod->mod);
     ctx->parsed_mod = calloc(1, sizeof(struct lysp_submodule));
     ctx->parsed_mod->mod = calloc(1, sizeof *ctx->parsed_mod->mod);
     lydict_insert(ly_ctx, "name", 0, &ctx->parsed_mod->mod->name);
@@ -764,7 +764,7 @@
     assert_int_equal(LY_EVALID, yang_parse_module(&ctx_p, &in, m, &unres));
     CHECK_LOG_CTX("Trailing garbage \"module q {names...\" after module, expected end-of-input.", "Line number 1.");
     yang_parser_ctx_free(ctx_p);
-    lys_module_free(m, NULL);
+    lys_module_free(m);
 
     in.current = "prefix " SCHEMA_BEGINNING "}";
     m = calloc(1, sizeof *m);
@@ -772,7 +772,7 @@
     assert_int_equal(LY_EVALID, yang_parse_module(&ctx_p, &in, m, &unres));
     CHECK_LOG_CTX("Invalid keyword \"prefix\", expected \"module\" or \"submodule\".", "Line number 1.");
     yang_parser_ctx_free(ctx_p);
-    lys_module_free(m, NULL);
+    lys_module_free(m);
 
     in.current = "module " SCHEMA_BEGINNING "leaf enum {type enumeration {enum seven { position 7;}}}}";
     m = calloc(1, sizeof *m);
@@ -780,7 +780,7 @@
     assert_int_equal(LY_EVALID, yang_parse_module(&ctx_p, &in, m, &unres));
     CHECK_LOG_CTX("Invalid keyword \"position\" as a child of \"enum\".", "Line number 1.");
     yang_parser_ctx_free(ctx_p);
-    lys_module_free(m, NULL);
+    lys_module_free(m);
 
     /* extensions */
     TEST_GENERIC("prefix:test;}", mod->exts,
diff --git a/tests/utests/schema/test_parser_yin.c b/tests/utests/schema/test_parser_yin.c
index 7c726ff..c283570 100644
--- a/tests/utests/schema/test_parser_yin.c
+++ b/tests/utests/schema/test_parser_yin.c
@@ -158,7 +158,7 @@
 teardown_ctx(void **UNUSED(state))
 {
     lyxml_ctx_free(YCTX->xmlctx);
-    lys_module_free(YCTX->parsed_mod->mod, NULL);
+    lys_module_free(YCTX->parsed_mod->mod);
     free(YCTX);
     YCTX = NULL;
 
@@ -3422,7 +3422,7 @@
 {
     struct ly_ctx *ly_ctx = ctx->parsed_mod->mod->ctx;
 
-    lys_module_free(ctx->parsed_mod->mod, NULL);
+    lys_module_free(ctx->parsed_mod->mod);
     ctx->parsed_mod = calloc(1, sizeof *ctx->parsed_mod);
     ctx->parsed_mod->mod = calloc(1, sizeof *ctx->parsed_mod->mod);
     ctx->parsed_mod->mod->parsed = ctx->parsed_mod;
@@ -3550,7 +3550,7 @@
 {
     struct ly_ctx *ly_ctx = ctx->parsed_mod->mod->ctx;
 
-    lys_module_free(ctx->parsed_mod->mod, NULL);
+    lys_module_free(ctx->parsed_mod->mod);
     ctx->parsed_mod = calloc(1, sizeof(struct lysp_submodule));
     ctx->parsed_mod->mod = calloc(1, sizeof *ctx->parsed_mod->mod);
     lydict_insert(ly_ctx, belongs_to, 0, &ctx->parsed_mod->mod->name);
@@ -3710,7 +3710,7 @@
     assert_null(mod->parsed->exts->child->next->child);
     assert_string_equal(mod->parsed->exts->child->next->arg, "test");
     lys_compile_unres_glob_erase(UTEST_LYCTX, &unres);
-    lys_module_free(mod, NULL);
+    lys_module_free(mod);
     yin_parser_ctx_free(yin_ctx);
     ly_in_free(in, 0);
     mod = NULL;
@@ -3749,7 +3749,7 @@
     assert_int_equal(ly_in_new_memory(data, &in), LY_SUCCESS);
     assert_int_equal(yin_parse_module(&yin_ctx, in, mod, &unres), LY_SUCCESS);
     lys_compile_unres_glob_erase(UTEST_LYCTX, &unres);
-    lys_module_free(mod, NULL);
+    lys_module_free(mod);
     yin_parser_ctx_free(yin_ctx);
     ly_in_free(in, 0);
     mod = NULL;
@@ -3765,7 +3765,7 @@
     assert_int_equal(ly_in_new_memory(data, &in), LY_SUCCESS);
     assert_int_equal(yin_parse_module(&yin_ctx, in, mod, &unres), LY_SUCCESS);
     lys_compile_unres_glob_erase(UTEST_LYCTX, &unres);
-    lys_module_free(mod, NULL);
+    lys_module_free(mod);
     yin_parser_ctx_free(yin_ctx);
     ly_in_free(in, 0);
     mod = NULL;
@@ -3778,7 +3778,7 @@
     assert_int_equal(ly_in_new_memory(data, &in), LY_SUCCESS);
     assert_int_equal(yin_parse_module(&yin_ctx, in, mod, &unres), LY_EINVAL);
     CHECK_LOG_CTX("Input data contains submodule which cannot be parsed directly without its main module.", NULL);
-    lys_module_free(mod, NULL);
+    lys_module_free(mod);
     yin_parser_ctx_free(yin_ctx);
     ly_in_free(in, 0);
 
@@ -3793,7 +3793,7 @@
     assert_int_equal(ly_in_new_memory(data, &in), LY_SUCCESS);
     assert_int_equal(yin_parse_module(&yin_ctx, in, mod, &unres), LY_EVALID);
     CHECK_LOG_CTX("Trailing garbage \"<module>\" after module, expected end-of-input.", "Line number 6.");
-    lys_module_free(mod, NULL);
+    lys_module_free(mod);
     yin_parser_ctx_free(yin_ctx);
     ly_in_free(in, 0);
     mod = NULL;
diff --git a/tests/utests/schema/test_schema_extensions.c b/tests/utests/schema/test_schema_extensions.c
index 7c15773..a2dad63 100644
--- a/tests/utests/schema/test_schema_extensions.c
+++ b/tests/utests/schema/test_schema_extensions.c
@@ -89,7 +89,7 @@
     free(printed);
 
     /* context reset */
-    ly_ctx_destroy(UTEST_LYCTX, NULL);
+    ly_ctx_destroy(UTEST_LYCTX);
     ly_ctx_new(NULL, 0, &UTEST_LYCTX);
 
     /* from YIN */
@@ -191,7 +191,7 @@
     free(printed);
 
     /* context reset */
-    ly_ctx_destroy(UTEST_LYCTX, NULL);
+    ly_ctx_destroy(UTEST_LYCTX);
     ly_ctx_new(NULL, 0, &UTEST_LYCTX);
 
     /* from YIN */