(TWILL-110) added state guard to prevent possible race-condition when shutting down zk client, which causes deadlock.

Signed-off-by: Terence Yim <chtyim@apache.org>