json: Fix memleak in native msging repl