Raise 400 error when DB constraints were broken

Implements blueprint nailgun-rest-db-constraint

Change-Id: I9b5f157fa0cc8d771ceb940a2c722a9446e2d676
Merge "Raise 400 error when DB constraints were broken"