Handle each key in a separate database transaction
Handle each key in a separate database transaction

Currently the insert of multiple keys is handled as a single database
transaction. If the insert of one key happens to fail (for example, the
keywords exceeds the maximum size of a tsvector), then the transaction
becomes invalid and all remaining inserts fail. Cap the number of errors
that can occur since this suggests something substantial is wrong.

Also, add a missing error check for a json.Marshal call.

cmars/hockeypuck,cmars/hockeypuck