Clean up sqlalchemy exception code

Moves DB exceptions that can be shared between DB implementations into
their own module.

Adds DBDeadlock() exception wrapping.  Nova has its own code for
determining Deadlock and it's better to consolidate it with
DBDuplicateKey checking.

Change-Id: I108bd0da2a14d62e460a997b1472f0b65bfc9b95
Merge "Clean up sqlalchemy exception code"