Fix infinite loop in libmemcache