Implement graceful exit when zookeeper session have expired (fixes #504)