Fixes to leader election.

Get the zookeeper address from the conf file, address requires both ip and port. Also makes sure edit log is flushed if it is being written into hdfs.