symbols: Fix duplicate symbols
Created by: chrismwendt
Caused by https://github.com/sourcegraph/sourcegraph/pull/20310/files?w=1#r816133824
Resolves https://github.com/sourcegraph/sourcegraph/issues/31934
Images from Camden's PR
Test plan
Added a test.