Since now on transaction deadlock detection is working (test cases 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.

Design decisions:
 * if thread calling waitFor() is interrupted, InterruptedException is thrown
 * if any of waitFor() participating transactions is terminated the waitFor() dependency
   is discarded and associated thread will continue in its execution
 * it is allowed for two distinct threads to create the same transaction waitFor() dependency.
   Such redundant dependencies will use separate condition objects (impl. decision due to simplicity).
fixing TransactionImpl finalization