[WebNN EP] Add contraints for MatMul (#19713)
### Description
Add constraints to MatMul:
- The input must be at least 2D.
- CPU backend: The input rank must be the same.
- CPU backend: The input shape except for the last two axis must be the
same.
### Motivation and Context
Prevent regression for some models.