MAINT: refactor packbits/unpackbits

Pushes the GIL release one loop outward.
Not "zero-dim", "empty".