ENH: spatial: reimplement cdist_cosine using np.dot

Also optimized row-norm operation for correlation distance.
ENH: spatial: use dotfunc in pdist(metric='cosine')

Suggested by @jaimefrio.