Only remove tx from thread if there is one. This fixes the NrOfOpenTransactions negative count bug