Merge pull request #3304 from pv/tnc-leak

BUG: optimize: fix refcount errors in tnc
TST ensure correct operation of has_sorted_indices
FIX use mangled attribute correctly
STY avoid mangled attributes in has_sorted_indices
DOC: add note about different ba forms
MAINT: remove numpy.matrix usage from linalg.matfuncs.py code and enable expm of more array_likes
DOC: clarify `limits` parameter in `winsorize` docstring.
STY: PEP8 the `scipy.stats.mstats.winsorize` function.
DOC: add short explanation to `scipy.stats.mstats.winsorize` doctring.
DOC: clarify matrix vs array in mmio docstrings

mmio docstrings and an error message seemed to imply use of np.matrix,
which is not the case.
BUG: fix behavior of write_values() with empty string in scipy.io.netcdf

fixes #1592
Merge pull request #3310 from matthew-brett/clarify-mmio-matrices

DOC: clarify matrix vs array in mmio docstrings
DOC: fix bpoly docstrings
API: remove axis & direction arguments of bpoly.from_derivatives

(They were not implemented anyway.) The idea is to keep the basic
object simple, and delegate complications to subclasses or wrappers.
MAINT: interpolate: move pchip to _monotone.py
MAINT: interpolate: reimplement pchip to use BPoly

The algorithm itself is intact.
STY: remove code duplication, rename pchip.p to pchip.bpoly
API: make pchip.derivative match PPoly.derivative

Previously, pchip.derivative used to return a value of f'(x)
at a fixed `x`. Now this can be achieved with pchip.__call__,
and pchip.derivative() returns a callable object, representing
the derivative. See gh-3267 for discussion.
ENH: add roots() method to the pchip interpolator.
MAINT: remove np.matrix from logm and matrix power
MAINT: remove np.matrix from sqrtm
DEP: deprecate scipy.linalg.special_matrices.all_mat