isl_mat_extend: avoid memory leak when realloc fails