When doing partition index scan without a priority queue (aka
"unordered scan"), pre-scan (introduced in
8eeb689e9f) is done on all partitions
but the actual scan may be done on necessary partitions only. By
default pq-less scans do not cause pre-scans but spider may override
that. This patch strengthens the requirement to override by checking
for presence of aggregate functions in the query to cover MIN/MAX.
Also fixing cursor protocol while we are at it.