Bug 3172 batch distance

fixed two issues for Bug #3172:
* Changed signature of cv::batchDistance to indicate that it permits repeated calls to update a preinitialized distance array. (cv::batchDistance is already used that way by DescriptorMatcher::knnMatch.)
* Fixed cv::batchDistance to not shrink (and thereby discard) a preinitialized output array if a target image has very few keypoints.