Move DEADLOCK_* constants into DatabaseBase

Change-Id: I75ea4c19c757adc96ba3c5afe0b85d8579b02c80
Merge "Move DEADLOCK_* constants into DatabaseBase"