Suggestion: pass a destructor function that verifies that the value in the TLS is either NULL, or that the transaction inside is closed (ie `txn` member is NULL). Otherwise, we have a transaction leak.