In order to shutdown properly we have introduced an AccessGuard, which will be checked on beginTx(). The different reasons why starting a tx might not be possible (e.g. database not started) will be setting it's state by granting or denying access. it's implemented with a backing AtomicInteger for performance mainly.
Formatting of changed files according to the Neo4j code style
Merge branch '1.9-maint' into propershutdown
Fixes compilation errors from InstanceAccessGuard to AvailabilityGuard switch
Set elected master id to null when we fail due to too few available instances. Otherwise we won't switch to master when the next election happens.
Merge pull request #1431 from rickardoberg/propershutdown

Proper shutdown