Fixes quorum check in ElectionState

The quorum check was wrong, leading to instances proceeding to do elections
 even when there were not enough instances left in the cluster, showing
 symptoms of split brain. This adds some tests and a fix for the issue

Conflicts:
	enterprise/cluster/src/main/java/org/neo4j/cluster/protocol/atomicbroadcast/multipaxos/MultiPaxosContext.java
Fix merge conflicts
Fixes and reenables ElectionStateTest.testElectionFromDemoteIsRejectedIfNoQuorum
Fixes slave deadlock problem.

 o Instances now only block access if they were already in a state
   where they allowed access in the first place. This way instances
   won't grab multiple locks on the database, which previously lead
   to the database blocking forever (locked several times, only opened
   once).
 o Refactored out quorum check into a utilty method and replaced incorrect
   majority checks in HighAvailabilityMemberStateMachine and MultiPaxosContext.

Conflicts:
	enterprise/cluster/src/main/java/org/neo4j/cluster/protocol/atomicbroadcast/multipaxos/MultiPaxosContext.java
Join denial includes received configuration state

and includes that in the ClusterEntryDeniedException resulting from that
denial. The one denying an instance already sent that in the message
payload, so this change has it picked up on the joining side.

Conflicts:
	enterprise/cluster/src/main/java/org/neo4j/cluster/protocol/atomicbroadcast/multipaxos/MultiPaxosContext.java
	enterprise/cluster/src/main/java/org/neo4j/cluster/protocol/cluster/ClusterContext.java
	enterprise/cluster/src/test/java/org/neo4j/cluster/protocol/cluster/ClusterMembershipTest.java
Join denial includes received configuration state

and includes that in the ClusterEntryDeniedException resulting from that
denial. The one denying an instance already sent that in the message
payload, so this change has it picked up on the joining side.

Conflicts:
	enterprise/cluster/src/main/java/org/neo4j/cluster/protocol/atomicbroadcast/multipaxos/MultiPaxosContext.java
	enterprise/cluster/src/main/java/org/neo4j/cluster/protocol/cluster/ClusterContext.java
	enterprise/cluster/src/test/java/org/neo4j/cluster/protocol/cluster/ClusterMembershipTest.java