MAINT: const correctness and minor fixes to C code
BUG: handle rounding issue with histogram edges on float32 data

Following inequality causes wrong counting at the edges and can be avoided by
making the edge array of the same type as the input data.

In [1]: np.around(np.float64(6010.36962890625), 5)
Out[1]: 6010.3696300000001
In [2]: np.around(np.float32(6010.36962890625), 5)
Out[2]: 6010.3701

Closes gh-4799
ENH: use copy to move the masked values into the result

saves a relatively expensive bool -> x cast
MAINT: replace two step errstate change with a direct change
Merge pull request #4823 from juliantaylor/hist-rounding

BUG: handle rounding issue with histogram edges on float32 data
Merge pull request #4822 from juliantaylor/masked-improv

small masked array performance enhancement
MAINT: Simplify some uses of errstate context manager.

This changes, e.g.,

    with np.errstate():
        np.seterr(divide='ignore')
        ...

to

    with np.errstate(divide='ignore'):
        ...
Move tempdir context manager to numpy.testing.utils
FIX isfileobj accepts write-mode files under PY3
MAINT: Use an unqualified nomask variable in ma.core.
Merge pull request #4832 from abalkin/nomask

MAINT: Use an unqualified nomask variable in ma.core.
Merge pull request #4828 from ogrisel/fix-isfileobj-py3

FIX isfileobj accepts write-mode files under PY3
Merge pull request #4831 from charris/simplify-with-errstate

MAINT: Simplify some uses of errstate context manager.
Merge pull request #4801 from larsmans/c-fixes

MAINT: const correctness and minor fixes to C code
BUG: pickling ufuncs defined in nested modules
Merge pull request #4800 from ogrisel/fix-ufunc-pickling

FIX pickling ufuncs defined in nested modules
BUG: limit type alignment to the largest alignment needed by numpy

clongdouble type required alignment of 32 bytes which is never provided
by numpys allocation scheme so they always took unaligned paths.
As complex types are structs of two smaller types only half the
alignment is actually required for operations on them.
Copying complex types on the other hand might require a larger alignment
as copies can be done on the whole structure so one can not just remove
the doubling of the alignment.

As a compromise limit the maximum alignment to 16 bytes which is double
what the current numpy copy loops require and does not penalize amd64
with unnecessary unaligned code paths in most cases.
16 bytes might be required on sparc to load long doubles.
Complex doubles on i386 will still unnecessarly take unaligned code
paths as the system will not provide 16 byte alignment.
Closes gh-3768
BUG: fix arrays wrapping foreign data losing their alignment flag

e.g. ufunc_at wraps input arrays which without this fix causes the
iterator to choose much slower unaligned code paths.
Also pointers from malloc can be not aligned for long double types, e.g.
on debian sparc.
BUG: fix transpose not updating alignment flag

transposing structured arrays can lose alignment
TST: disable tests that fail due to bad alignment on sparc

(debian) sparc system malloc does not provide the alignment required by 16 byte
long double types this means the inout intent cannot be satisfied and several
tests fail as the alignment flag can be randomly true or fals when numpy gains
an aligned allocator the tests could be enabled again.