[MPS] Fix crashes in several backward ops (#94343)
This should fix the hard crashes in several backward-pass ops for sigmoid, tanh, masked_fill, linear, prelu, etc.
The tests cases that this patch fixes are part of a bigger change in TestConsistency and will be upstreamed as a separate PR.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/94343
Approved by: https://github.com/kulinseth, https://github.com/malfet