fix some memory leaks in mpf_mat