avoid slow loop on fd close.