proposed change for dbtext query results.
this behaviour was observed by interacting with module presence.

presentity clean runs from timer every 6 secs.
if the first run returns a large set of rows, it iterates all rows doing
some notifications and deleting the presentity.
if it takes more then 6 secs to complete, the next run will override the
results internal structure pointer maintained in the connection level.

the proposed patch, maintains the query result internal structure within
the result, using the ptr field for that.