CURATOR-126: Fix race condition in CuratorFrameworkImpl.close()

This is unrelated to the main change.  While I was in here, I noticed this method was more complicated than it needed to be.  I could revert this section if you guys would prefer to isolate changes.