Guard all indexed access in WeakInstanceDict
Added ``KeyError`` checks to all methods within
:class:`.WeakInstanceDict` where a check for ``key in dict`` is
followed by indexed access to that key, to guard against a race against
garbage collection that under load can remove the key from the dict
after the code assumes its present, leading to very infrequent
``KeyError`` raises.
Change-Id: I881cc2899f7961d29a0549f44149a2615ae7a4ea
Fixes: #4030
(cherry picked from commit
1a75f676d75b5daf67455d6e85b7b4df6f2316dc)