modstruct: Fix alignment handling issues.

Also, factor out mp_binary_get_int() function.