*: fix panic when reusing `OptimisticTxnContextProvider` (#38952)
*: fix panic when reusing `OptimisticTxnContextProvider` (#38952)

close pingcap/tidb#38951
pingcap/tidb,pingcap/tidb,pingcap/tidb,pingcap/tidb,pingcap/tidb,pingcap/tidb