Consider global shard count when choosing victim
Fix bug in degeneracy-breaking sort

The global sort was only being invoked when two nodes owned the exact
same shards, rather than when they owned the same number of shards.