Initialize length to 0 in json_array_new and json_object_new