Made APIs consistently accept a query in the request body's `query` field

The following APIs now accept the query in a top level `query` field like:
* delete_by_query
* validate_query
* count

These APIs used to accept the query directly in the request body which was inconsistent with the search and explain APIs. For this reason this is a breaking change.

Relates to #4074