log BUGFIX thread-safe temporary logging options

Logging options were being modified to disable
logging for specific tasks but when executed
in several threads, the options were not restored
correctly.
diff --git a/src/tree_schema.c b/src/tree_schema.c
index 49ec92c..5c897bf 100644
--- a/src/tree_schema.c
+++ b/src/tree_schema.c
@@ -1035,7 +1035,7 @@
 void
 lys_unres_glob_revert(struct ly_ctx *ctx, struct lys_glob_unres *unres)
 {
-    uint32_t i, j, idx, prev_lo;
+    uint32_t i, j, idx, temp_lo = 0;
     struct lysf_ctx fctx = {.ctx = ctx};
     struct ly_set *dep_set;
     LY_ERR ret;
@@ -1079,9 +1079,9 @@
     if (unres->implementing.count) {
         /* recompile previous context because some implemented modules are no longer implemented,
          * we can reuse the current to_compile flags */
-        prev_lo = ly_log_options(0);
+        ly_temp_log_options(&temp_lo);
         ret = lys_compile_depset_all(ctx, &ctx->unres);
-        ly_log_options(prev_lo);
+        ly_temp_log_options(NULL);
         if (ret) {
             LOGINT(ctx);
         }