topic: don't cache topic of e.g. memctx in _topiccache (issue6500)

_topiccache exists to make us hit the storage less often when we want to look
at topics for any reason. It doesn't make much sense to cache something that is
memory-only and is cheap to access however. Caching things like that was also a
source of a bug where creating multiple memctx instances in one process would
cache topic of the first one and ignore actual content of .extra() of the
others. That was happening because the cache is keyed by .rev(), but all memctx
instances have the same .rev() = None.

--HG--
branch : stable
8 jobs for topic/stable/del-extra-topic in 14 minutes and 13 seconds (queued for 1 second)
Status Name Job ID Coverage
  Test
passed checks-py2 #242311

00:02:26

passed checks-py3 #242312

00:02:39

passed doc #242317

00:01:34

manual pytype #242310
allowed to fail manual
passed tests-py2-cext #242313

00:11:33

passed tests-py2-pure #242314

00:12:53

passed tests-py3-cext #242315

00:13:56

passed tests-py3-pure #242316

00:14:10