Add the ability to throw exceptions that trigger transaction retries, ala deadlocks

I don't think I'm actually going to have an immediate need for this (overriding _is_deadlock works better), it seems like a useful and good feature to have.