Catch longs for packing in pack_list

When, for example, id's are generated in python 2, they are 32-bit
unsigned values, and so are returned as long's. This properly catches
longs for conversion to byte arrays when packing.