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
Merge pull request #12100 from owncloud/fix-infinite-loop

Fix infinite loop if count and limit is 0