[mlir][vector] Fix mask rank extension for TransferWriteNonPermutationLowering (#229852)
When a `vector.transfer_write`'s permutation map skips a dim between the
dims that are written to, e.g. `(d0, d1, d2, d3) -> (d1, d3)`,
`TransferWriteNonPermutationLowering` adds a unit dim for it. The vector
got that unit dim in the right place, but the mask always got it at the
end. The new write then failed to verify:
```
'vector.transfer_write' op inferred mask type ('vector<7x1x8xi1>') and mask operand type ('vector<7x8x1xi1>') don't match
```
`-convert-vector-to-scf` runs the same pattern and fails on such a write
too.
This puts the mask's unit dims at the positions of the missing dims.
This is #144893 by @Groverkss, moved to the current builder API. The
test uses a map that also skips the leading dim, so the offset from the
first written dim is covered as well.
Part of #227821.
Assisted-by: Claude
---------
Co-authored-by: Kunwar Grover <groverkss@gmail.com>