Guard against search cursors with a query of ""

They'd exhibit the same infinite traversal behavior mentioned in
#1155