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.