[jit] Minor: avoid recalculating some keys for map accesses in pickler. (#33060)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/33060
Noticed this when tracking down a partially-related SIGSEGV.
If inserting a non-present key into a memoized map, don't re-calculate it twice
(probably safer that way anyway).
ghstack-source-id: 97904485
Test Plan: buck test mode/dev-nosan caffe2/test/...
Differential Revision: D19778008
fbshipit-source-id: 95b1d708c034a54b96a22ccbdffb24f72d08dffd