json: fix memory corruption in ARRAY type