api: fix read of arrays in hdata functions hdata_<type> (bug #40354)