mark thread as transactional only if transaction started successfully
Added some TransactionImpl and test improvements.
Merge pull request #3186 from mdogan/fix/3.3/tx

[Forward Port] Exception in TransactionImpl#begin method can leave thread in unusable state to 3.3