ENH: spatial: adds query_subset to KDTree

allows efficient search of nearest neighbors constrained to a subset of the data indices (#4236)