isl_mat_extend: properly extend matrices with reordered rows