#5492: Avoid traceback when exiting IDLE caused by a race condition.