Fix MatmulTransposeFusion when input A and B are the same (#24373)
### Description
MatmulTransposeFusion does not work correctly when input A and B are the
same for a `MatMul` node.

Fixes #24341
### Motivation and Context
<!-- - Why is this change required? What problem does it solve?
- If it fixes an open issue, please link to the issue here. -->