Fix npz header incompatibility

Fixes #5170.

In addition,  *.npy test files produced in both Python2 and Python3 are added so that compatibility between versions can be tested.

Rebased for backport to 1.9. 
My feeling is that the condition should be easily distinguished from the body. See also PEP8, indentation. The other option is a (useless) comment ;)