Use 'I' in struct.pack and not 'L'.

On x86_64, 'L' gives an 8-byte string. 'I' gives a four-byte string on
x86 and x86_64.