[PyTorch] Fix extra refcount bumps in unifyTypes (#66718)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/66718
Some missing moves and use of cast instead of castRaw (due to a previous automated fixup only being a partial fix).
ghstack-source-id: 140755229
Test Plan: CI
Reviewed By: suo
Differential Revision: D31697115
fbshipit-source-id: 86743f8982951a58638ba244b3a92d3737dde58b