MAINT: Use np.errstate context manager.

Now that Python < 2.6 is no longer supported we can use the errstate
context manager in places where constructs like
```
    old = seterr(invalid='ignore')
    try:
        blah
    finally:
       seterr(**old)
```
were used.
MAINT: Fix Python version dependent test.

The buffer test in numpy/core/tests/test_api.py was apparently
testing for incorrect behavior that was corrected in Python 2.7.5.
This PR changes the test to check for the correct results and makes
running it depend on Python version.

Closes #3512.
ENH: improve numpy.all()/any()

Unroll the loop once and use pminub/pmaxub to save a slow pmovmskb
instruction. Improves performance by 50% on some AMD chips.
Also add a pure libc path using memcmp and memchr for non amd64 systems.
The libc path can be faster with a very modern cpu and libc version,
e.g. an i7 with glibc 2.17 is about 20% faster than our code but many
other tested platforms are much slower (2.12 xeon, core2duo) or same
speed (2.17 phenom).
The numpy code can be removed in future when faster libc versions and
cpus are more commonly available.
ENH: change npy_aligned_block_offset and npy_blocked_end to unsigned int

saves 10 instructions in the loop simd setups as with unsigned int the
modulo power of two operations can be replaced with a single and
instruction.