Close fd before attempting connect to zookeeper