Wrap account creation in a (sub-)transaction

Because otherwise any error will break the transaction (Postgres sez: "current transaction is aborted, commands ignored until end of transaction block") and we cannot catch it.