Fix seldom deadlock.