MAINT: refactor packbits/unpackbits

Pushes the GIL release one loop outward.
An obvious use of packbits is to pack Boolean arrays (e.g., graphs).  Please ensure this is an acceptable input.