Ticket #3181 do the state flushing only on down gateway detection rather than any time.