[PyTorch] Use c10::FastMap for memoizing in Pickler (#96360)
These maps don't rely on reference stability, so FastMap should be fine.
Differential Revision: [D43926671](https://our.internmc.facebook.com/intern/diff/D43926671/)
Pull Request resolved: https://github.com/pytorch/pytorch/pull/96360
Approved by: https://github.com/ezyang