KNN graph fails for sparse inputs

In IRC, @fmailhot reports `LabelSpreading` fails for sparse inputs. The reason seems to be in buidling knn  graph, `np.asarray` converts sparse matrix to matrix of objects and should be replaced by `safe_asarray`.