Fix memory leak in ts_json_parse_object()