Fix npz open file handle issue in formats.pyx