MAINT: refactor packbits/unpackbits

Pushes the GIL release one loop outward.
Why is both this and `pack_inner` needed. I note that this function has a slightly improved method of determining the truth value of the elements.