dbutil: Extract and reuse postgres batch inserter
Created by: efritz
This closes https://github.com/sourcegraph/sourcegraph/issues/14608.
This PR moves the Postgres batch inserter utility into the internal/db pacakge, then uses the inserter in a few places where a similar (but less sophisticated) process was being done in the code intel store.