[MRG+2] : Bug fix in computing the dataset_centroid in NearestCentroid

Continuation of work in https://github.com/scikit-learn/scikit-learn/pull/3746. 
There is a bug in L111 of the current code, where the mean of the first feature is taken as the centroid.

A bit more of minor numpy vectorization and code optimizations were added. I also added a test to verify the behavior that fails in master.