MAINT: spatial.distance: generate boilerplate with macros
BUG: spatial.distance: fix unchecked malloc
MAINT: spatial.distance: further refactoring

* static on all functions in distance_impl.h
* commented out unused compute_mean_vector
* replaced &&, || with &, | in tight loops
* reindented code according to NumPy conventions
* removed some useless variables
Merge pull request #3948 from larsmans/distance-refactor

Big refactor of spatial.distance