Fix `api_swhid_known` when swhids share hash part
We need to have separate sets for each type of object.
I have some other cleanups in minds, but this can fix the bug without touching other repos for now.
Resolves #4224 (closed)
Migrated from D7748 (view on Phabricator)