Since now on transaction deadlock detection is atomic (test case provided).

Previous solution didn't work because deadlock detection was using
LockSupport.getBlocker() which didn't work as intended. The reason was
the LockSupport.park() was called after deadlock detection finished.
In order to make deadlock detection to work transactions dependency
must be registered first.