Fix infinite loop if count and limit is 0

* otherwise it will always think it hits the limit and need another round to fetch additional results

fixes #12098 

cc @blizzz @PVince81