[PyTorch] Fix ASAN errors in CPU MHA impl (#72458)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/72458
Now ASAN stops flagging errors during the MHA test (though the results are still incorrect).
ghstack-source-id: 149067334
Test Plan: buck test mode/dbg-asan-ubsan mode/no-gpu //caffe2/test:nn -- -r test_native_multihead_attention_cpu_float32
Reviewed By: zrphercule
Differential Revision: D33956797
fbshipit-source-id: 6824987f8a9ad55c4409eda5b3a2a5cbc535312f
(cherry picked from commit f5a9dfdff9ac121b36758a7a34eca40875b85bb0)