Revert "Revert back the behaviour to cleanup all states for 2.1 Fixes #3181 and related to Ticket #1629. This commit is only for 2.1 since on master development will continue for better alternatives"

A bit too excessive need to get right.

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