Add current state machine instance to thread local