Checking the tables order when rows are locking

Deadlock detector checks the order of locked tables. In case of
not allowed locking order exception with locks and traceback
information is raised. Detection enabled only in DEVELOPMENT
mode. Deadlock detector only prevents the posibility of deadlocks

Change-Id: I4097aa2ad8942bf852d0e89054e13500fbfc6646
Closes-Bug: #1319668
Merge "Checking the tables order when rows are locking"