Raise DBReferenceError on foreign key violation

SQLAlchemy session code now parses foreign key violations and returns a
new custom exception so we can track them.

Change-Id: If5610b5743203a5c34ac7df240e5332c39911c4a
Merge "Raise DBReferenceError on foreign key violation"