Fix bug in kneighbors_graph when mode=distance