[PyTorch] Second try: use c10::FastMap for memoizing in Pickler (#96688)
These maps don't rely on reference stability, so FastMap should be fine.
First try (#96360) was reverted because it broke internal tests.
Differential Revision: [D43995796](https://our.internmc.facebook.com/intern/diff/D43995796/)
**NOTE FOR REVIEWERS**: This PR has internal Meta-specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D43995796/)!
Pull Request resolved: https://github.com/pytorch/pytorch/pull/96688
Approved by: https://github.com/malfet