[BE][MPS] Do not use malloc/free in 2022 (#88307)
Use `std::vector` to store tensor shapes and automatically free them when array goes out of scope
Pull Request resolved: https://github.com/pytorch/pytorch/pull/88307
Approved by: https://github.com/kulinseth