[Ref #1824] Fix TypeError if got empty rows from findAndCountAll() with group

This error does not exist in version 2.0.0-dev11, so that I have not find out the origin of the bug, and make this fix for version 1.7.x.