MAINT: refactor packbits/unpackbits

Pushes the GIL release one loop outward.
Could remove this blank line.