ENH: spatial: use dotfunc in pdist(metric='cosine')

Suggested by @jaimefrio.