Blacklist->whitelist for reference scans in order!

Stop special-casing Arel::Nodes as exempt from reference scanning in
order. Instead, only scan order values that are strings for a table
reference.
re-introduce `select_for_count` private method.

See https://github.com/rails/rails/commit/da9b5d4a8435b744fcf278fffd6d7f1e36d4a4f2#commitcomment-3630064 for discussion.
Merge pull request #11439 from ernie/only-scan-strings-for-nodes

Blacklist->whitelist for reference scans in order!