Clear limit for all JDatabaseQuery objects

Same fix as #4330 but for queries which containg GROUP BY and/or HAVING.

### Issue
Pagination doesn't show at all.

### Testing
Issue has been raised in #4472 with the component JDownloads (http://www.jdownloads.com/index.php?option=com_jdownloads&Itemid=133&view=viewdownload&catid=43&cid=337). The issue doesn't show itself in core to my knowledge. So to test, best is to use JDownloads or any other 3rd party extension which uses a query with GROUP BY or HAVING clauses.

When testing especially make sure nothing else breaks.