json BUGFIX invalid free in lyjson_ctx_set_value

Check whether the previous jsonctx->value was dynamic when freeing it,
instead of checking whether the one that is currently being set is
dynamic.
diff --git a/src/json.c b/src/json.c
index ffe322f..95c5bda 100644
--- a/src/json.c
+++ b/src/json.c
@@ -91,7 +91,7 @@
 {
     assert(jsonctx);
 
-    if (dynamic) {
+    if (jsonctx->dynamic) {
         free((char *)jsonctx->value);
     }
     jsonctx->value = value;