Fixes potential race with duplicate votes from a particular instance

If an election times out, is cancelled and retried, it is possible for
 an instance to respond twice *after* the cancellation if its message
 is delayed for some reason. This can lead to both votes being counted,
 the required vote count reached earlier and eventually the election
 concluding with a wrong result.
 This commit fixes this by keeping the votes in a map so the latest
 overrides the previous and keeps the count correct.
Another way to go about the same result would be to have a
 monotonically increasing election id issued by the elector. While
 more correct, it's more complicated so this solution is evaluated
 first.
Merge branch '1.9-maint' into filtered-votes
Replace Java 7 getHostString with a static utility method in ServerUtil
Many flappy HA tests seemed to run into the problem that the first heartbeat from a joining instance comes too late. This commit changes so that a joining instance instead of setting up a timeout to send its first heartbeat to everyone else, it sends it out immediately. This should help adjusting the timeouts and minimize unnecessary failure suspicions.
Merge pull request #1388 from digitalstain/filtered-votes

Fixes potential race with duplicate votes from a particular instance
Removed usage of 1.7 API
Getting a snapshot does now not update our sense of last delivered instance id
SettingsTest now check that lists like "1,2,3,4," are parseable
Elections now don't ask coordinator to vote if it has already voted
Misc. format fixes
Merge branch '1.9-maint' into masterfix
Removed sout
Merge branch '1.9-maint' into masterfix