codeintel: Fix reference counts for indexes that re-declare packages
Created by: efritz
This can be seen most aggressively with lsif-node's output of sourcegraph/sourcegraph. When resolving xrepo code intelligence queries, we'll look to find what packages declare a given moniker.
In the case of sg/sg, client/{shared,branded,wildcard,etc} all declare version 0.0.0 in package.json. This means that every commit re-declares the same package, so that on xrepo results, we'll check basically every upload known for that repository for references.
This also has an effect with the reference count on each upload record (used for data retention). Currently, Cloud is unable to remove any sg/sg index because it's incorrectly referenced by some future commit.
We need to look into how to ensure that there's a maximum number of uploads that can declare the same package version for the same repository.