[AArch64] Fix a compiler crash in MachineSink (#67705)

There were a couple of issues with maintaining register def/uses held
in `MachineRegisterInfo`:

* when an operand is changed from one register to another, the
corresponding instruction must already be inserted into the function,
or MRI won't be updated

* when traversing the set of all uses of a register, that set must not
change

GitOrigin-RevId: b454b04d686991626f2de7ad639456bfc96c510a
2 files changed