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.