Fix memory leaks in json_equal() tests