lockfiles: Pick last version of go.sum deps
Created by: tsenart
This commit makes us pick the last version of each dependency in go.sum files instead of all of them.
This should be correct most of the time as observed in our own repository, but for 100% accurate dependencies information that runs Minimum Version Selection we should defer to lsif-go indexing, which will be usable in dependencies search when #31638 (closed) is tackled.
Stacked on #32999
Test plan
Unit tests.