Change of Promise.PSD and Transaction._lock()

Optimization: No new PSD scope by default in every Promise.
Instead, use the new static method Promise.newPSD() each time a PSD
scope is required.

Recursive write-locking of a transaction was previously accomplished by
using the instanceof operator. Now simplified using a PSD member
pointing out the transaction that this PSD scope owns.

Sub-transactions bugfix: If a sub-transaction failed with an exception
and its parent transaction had a queued operation to resume after
sub-transaction completes, the parent transaction would fail with
"Transaction inactive" instead of the real error in the sub transaction.