Convert `category__and` to `category__in` (less expensive) and unset it when only one category is passed. Adds unit tests.

Fixes #24245.



Built from https://develop.svn.wordpress.org/trunk@25238


git-svn-id: http://core.svn.wordpress.org/trunk@25208 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Kill the query in the following edge case: `post_type => 'any'` but `exclude_from_search => false` returns no valid post types. Adds unit tests.

Props mitchoyoshitaka.
Fixes #19198.


Built from https://develop.svn.wordpress.org/trunk@25239


git-svn-id: http://core.svn.wordpress.org/trunk@25209 1a063a9b-81f0-0310-95a4-ce76da25c4cd