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.
I think it makes sense to just change the default to 0, it does not really make sense for the user to set it to 0. maybe even throw an exception when they want to set it.