[MPS] Fix the index error in constant_pad_nd() with single-dimension input (#83745)
* Fix the index error in constant_pad_nd() with single-dimension input (#83343)
- Also added a test case in test_mps for it
* Move padding code into new file Pad.mm
Fixes https://github.com/pytorch/pytorch/issues/83343
Pull Request resolved: https://github.com/pytorch/pytorch/pull/83745
Approved by: https://github.com/razarmehr