Background connection errors would go straight to LOST which is different than foreground connection errors. Changed so that background connection errors go to SUSPENDED first just like foreground connection errors.
Continued re-work on the connection state transitions involving background/async APIs.

ConnectionStateManager now uses synchronization. This shouldn't hurt performance but rationalizes state changes from foreground/background ops.

Background errors now go through same code as foreground errors. Transition to LOST is handled specifically instead of generally in logError().
CURATOR-81
Only STATIC instances should be cleaned
fixed some typos
Another edge case found Evaristo. When the SUSPEND is set, a background sync is executed to detect LOST. If the ZK connection is reset while this command is processing an incorrect LOST might get set. Instead, keep track of ZooKeeper instance reset. If there is a reset ignore the background sync failure and re-submit the sync to test again.
Another edge case found by Evaristo. When the SUSPEND is set, a background sync is executed to detect LOST. If the ZK connection is reset while this command is processing an incorrect LOST might get set. Instead, keep track of ZooKeeper instance reset. If there is a reset ignore the background sync failure and re-submit the sync to test again.
Merge branch 'CURATOR-72' of https://git-wip-us.apache.org/repos/asf/curator into CURATOR-72
Previous version was incorrectly re-using the instanceIndex. Need to use latest value
patch from Evaristo to possibly finalize this change
if doSyncForSuspendedConnection repeatedly fails there may be an infinite loop of connection resets. So, after the first reset (signaled by getInstanceIndex value changing) give up and mark the connection LOST
don't need to hoist value anymore
added a comment
CURATOR-85 - Guava no longer has closeQuietly(). This change adds the implementation internally to Curator
Merge branch 'master' into CURATOR-72
CURATOR-75 InterProcessSemaphoreV2 with a SharedCountReader wasn't notifying if shared count was changed
Merge branch 'CURATOR-72'
[maven-release-plugin] prepare release 2.4.0
[maven-release-plugin] prepare for next development iteration
Updated for changes in connection state logic
I'm now -5 UTC