Always use PERSISTENT_STATE mask when persisting task controller state.
When PERSISTENT_STATE mask was not used it was causing Revertibles
to be called twice (because DO_ROLLBACK) flag have been persisted too.
Expose Transaction.isTerminated() method via API.

This method is very convenient because multiple
threads may operate on the transaction. Sample usage:

txn.waitFor(otherTxn);
if (!txn.isTerminated()) {
   // ... do something with txn
}

Of course there's still possibility of check-then-act like race conditions,
but there's at least some way for the thread to check the status of transaction
without registering listener with it (what may fail too if transaction is not in expected state).
rely on AbstractTransactionTest.tearDown() to shutdown executor
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
Refactoring - reviewed TaskParent and TaskChild interfaces.

This change introduces no functional changes.
It just removes unused method parameters
and updates javadoc accordingly.
Refactoring userThread flag
cachedDependents optimization
Fixing children add (can be registered with task controller only at EXECUTE_WAIT or EXECUTE state)
fixing generic bug - subtasks may have different result type for executables than parent task
Require JDK 1.7+
Location support for problems
Add missing validation
every dependency can be added only once
Revisited TaskControllerImpl.dependentAdded() method.
 * We allow dependents adding only in EXECUTE_WAIT, EXECUTE, EXECUTE_DONE, TERMINATE_WAIT & TERMINATE task controller state.
 * Fixed dependentAdded() switch statement accordingly.
optimization - removing unlikely() method
 * it saves one wrapping method call around boolean expressions
 * if statements without unlikely() are also human reader friendly
 * 'if statement' followed with 'throw new' phrase is sufficient
   to recognize that such condition(s) is(are) unlikely
Propagate ROLLBACK_REQ from parent to chilren tasks
When task controller child is terminated, decrease both unfinishedChildren & unvalidatedChildren.
The idea of the fix is the same as the one documented in commit 0ba5c2f44951472dc0a838edfb0cf4c9950dcdbf
Children should start committing after parent task is committed.
child tasks can be added at EXECUTE state only