fix pipe leftover data

I found the kazoo client can make cpu usage jump to 100% in certain situation. 

I traced down the problem to be an inconsistency where there is no write request in the queue but there is data in the read-pipe. In this situation, the kazoo-client entered an unrecoverable loop which kept polling the ready read-pipe but failed to clear it causing cpu to busy spin.