[Discovery] Master election should demotes nodes which try to join the cluster for the first time

With the change in #7493 ,  we introduced a pinging round when a master nodes goes down. That pinging round helps validating the current state of the cluster and takes, by default, 3 seconds. It may be that during that window, a new node tries to join the cluster and starts pinging (this is typical when you quickly restart the current master).  If this node gets elected as the new master it will force recovery from the gateway (it has no in memory cluster state), which in turn will cause a full cluster shard synchronisation. While this is not a problem on it's own, it's a shame. This commit demotes "new" nodes during master election so the will only be elected if really needed.
if these collections are used for iteration I'd use something that has a stable iteration order instead of hashSet which might be different due to object identity and rehashing etc. I butt we should force this on the interface in `electMaster` further down the road