[utils,compat] Move struct_pack and struct_unpack to compat.py