fwrite() infinit loop

Based on this comment http://www.php.net/manual/en/function.fwrite.php#96951 there are cases where the client can loose connection to Redis and get stuck in an infinite loop.