Rewritten TransactionalLock.lock() method to be completely asynchronous.
Previous implementation was relying on wait-and-notify builtin mechanism in
Transations.waitFor(txn1, txn2) method.