Fixed possible reference leaks in the _json module.