osbase/build/kconfig-patcher: replace to_json with json.encode

to_json isn't available in Bazel 8

Change-Id: Ic00091d2e1ea3b6acf1f712ed3653dc9d0c167f1
Reviewed-on: https://review.monogon.dev/c/monogon/+/3940
Tested-by: Jenkins CI
Reviewed-by: Leopold Schabel <leo@monogon.tech>
diff --git a/osbase/build/kconfig-patcher/kconfig-patcher.bzl b/osbase/build/kconfig-patcher/kconfig-patcher.bzl
index 39e786e..dc43cfe 100644
--- a/osbase/build/kconfig-patcher/kconfig-patcher.bzl
+++ b/osbase/build/kconfig-patcher/kconfig-patcher.bzl
@@ -28,6 +28,6 @@
         cmd = """
         $(location //osbase/build/kconfig-patcher) \
             -in $< -out $@ '%s'
-        """ % struct(overrides = override_configs).to_json(),
+        """ % json.encode(struct(overrides = override_configs)),
         **kwargs
     )