Added utility method to CountRequestBuilder

Allows to add a query to CountRequestBuilder as a XContentBuilder.

Closes #8594