If zookeeper is down when discovery is started, it fails to register
when the zookeeper comes up for the first time. This commit has fix for
the same issue.