Fix memory pre-allocation when permuting inner vectors of a sparse matrix.