topic: fix the `topic(...)` revset to not select commits without a topic

The problem seems to be that the now removed __contains__ check would select any
revision indicated by a non-string argument.  This led to `topic(head())`
returning a bunch of non-topic heads, though not as many as simply `head()`.

I'm likely misunderstanding something, because there appears to be a similar
__contains__ check for `branch()` in core.  But maybe that's just harder to see
the issue, because branch names doesn't disappear like topics.
8 jobs for topic/default/topic_revset_filtering in 4 minutes and 4 seconds (queued for 1 second)
Status Job ID Name Coverage
  Test
passed #102267
checks-py2

00:02:26

passed #102268
checks-py3

00:02:39

passed #102273
doc

00:00:33

manual #102266
allowed to fail manual
pytype
passed #102269
tests-py2-cext

00:03:49

passed #102270
tests-py2-pure

00:03:25

passed #102271
tests-py3-cext

00:04:04

passed #102272
tests-py3-pure

00:03:42