added explicit cast of statistic in h5_write of legendre and matsubara