Optimization: limit the revision numbers scanned if revision prefix is specified

I was investigating slow performance of ivy:buildnumber task. Turned out it was slow because descriptor was optional on resolver configurations, so in addition to ivy descriptors, jar artifacts were being checked (AbstractPatternsBasedResolver:175) and separate HTTP requests were being made for every single revision to resolve the [artifact] token from the artifact pattern http://localhost:8081/artifactory/evrepov/[organization]/[module]/[revision]/[type]s/[artifact]-[revision].[ext].

Currently remaining tokens are unnecessarily being resolved for every revision even when revision prefix is specified on ivy:buildnumber, although this gives opportunity for significant optimization.

This is the patch to limit the remaining token resolutions only to revisions matching the revision prefix specified in buildnumber.

I was having a few JUnit test failures with clean source tree from master for some reason - this patch does not increase JUnit failure count, but this is probably something to be checked by someone more familiar with the project.