Fix infinite loop in Client.logs(stream=True) caused by connection close.