session: release lock correctly for tidb to exit (#34126)
session: release lock correctly for tidb to exit (#34126)

close pingcap/tidb#34123
ngaut/tidb,pingcap/tidb,pingcap/tidb,c4pt0r/tidb,kyle-wang/tidb,c4pt0r/tidb,c4pt0r/tidb,ngaut/tidb,kyle-wang/tidb,ngaut/tidb,c4pt0r/tidb,pingcap/tidb,pingcap/tidb,c4pt0r/tidb,c4pt0r/tidb,kyle-wang/tidb,ngaut/tidb,kyle-wang/tidb,kyle-wang/tidb,ngaut/tidb,pingcap/tidb,ngaut/tidb,kyle-wang/tidb,pingcap/tidb