json_dump*(): Don't crash if json is NULL and JSON_ENCODE_ANY is set