[Discovery] when master is gone, flush all pending cluster states

If the master FD flags master as gone while there are still pending cluster states, the processing of those cluster states we re-instate that node a master again.

Closes #6526