(NC-192) Add more checks for uniqueness violations.

Factor out the uniqueness error handling into something reusable, and
use it to improve error messages on any transaction where we might run
into a uniqueness violation. Since keeping the offending entity around
all the places we want to use this is a bit of a hassle, remove that
from the exception handling and the error response returned to the
client.

None of the changes to the transactions in postgres.clj are functional,
they're just indentation changes due to the wrapping.