internal/postgres: update latest good version in a transaction
internal/postgres: update latest good version in a transaction

Wrap postgres.DB.UpdateLatestGoodVersion in a transaction.

This method is called when we delete a module. Since it wasn't running
in a transaction, it could race with the similar call inside
insertModule. This should fix the race condition.

Change-Id: I91d0ae5c0060df16266e5e30230c981f5fbe994e
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/338173
Trust: Jonathan Amsterdam <e3d3698b2ccd5955e4adf250d0785062d0f9018b@google.com>
Run-TryBot: Jonathan Amsterdam <e3d3698b2ccd5955e4adf250d0785062d0f9018b@google.com>
TryBot-Result: kokoro <2ac7b1f3fa578934c95181d4272be0d3bca00121@google.com>
Reviewed-by: Julie Qiu <8d32267b6b4884cf35adeaccde2b6857ae11aace@golang.org>

golang/pkgsite,golang/pkgsite,golang/pkgsite,golang/pkgsite