internal/postgres: check parsing errors & fix patch parsing
internal/postgres: check parsing errors & fix patch parsing

This CL adds error checking for the semver parsing in InsertVersion.
It also fixes patch parsing so that it properly isolates the number
string when there is a prerelease.

Fixes b/129717943

Change-Id: I542b533d9508027917b1f9fa63867607b31d23fc
Reviewed-on: https://team-review.git.corp.google.com/c/golang/discovery/+/443170
Reviewed-by: Julie Qiu <e6cb64861edcc38971590ff27c111e0e672de045@google.com>

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