Implement early termination for Count API, if threshold is provided

A new request param `threshold` is added, which will allow Count query to early terminate, once the number of matched docs is equal to `threshold` for every shard. This will be helpful for exists-type functionality.
Also +1 on using EarlyTerminatingCountCollector in percolator. The in-memory index only has one segment, but in the case when percolating a document with nested inner objects multiple in-memory indices are wrapped with a SlowCompositeReaderWrapper and in that case early terminating is beneficial.