fix race condition

There was a race condition when the lookupd server was closed. The client was
still trying to write to it on PING.
fix origin