Handle races in Dispose logic.