add flag for JSON_ENCODE_ANY to json_dumps, resolves apparent races