Fix duplicate queries when mixing get_cursor and queryset.iterator()