Solves issue where StackOverflow would happen from recursive call in ZooClient.writeHaServerConfig()

Now the retry happens only when the exceptions are recoverable and retrying is certain to work.