log FEATURE optionally store ly_err errors in ctx

It also uses the standard API now so that the
behavior is always the same.
diff --git a/src/xpath.c b/src/xpath.c
index 9e672b5..2defc5a 100644
--- a/src/xpath.c
+++ b/src/xpath.c
@@ -3821,7 +3821,7 @@
         }
 
         if (err) {
-            ly_err_print(err);
+            ly_err_print(set->ctx, err);
             ly_err_free(err);
         }
         LY_CHECK_RET(rc);
@@ -4600,7 +4600,7 @@
     free(*pattern);
     LY_ARRAY_FREE(patterns);
     if (rc && (rc != LY_EVALID)) {
-        ly_err_print(err);
+        ly_err_print(set->ctx, err);
         ly_err_free(err);
         return rc;
     }