BUG: avoid infinite weights in kNN regression

Same issue as #2941, but in the regressor instead of the classifier.