refs #6684, fix icp bug of queries that do multiple index_next_same calls with the same cursor