Fix Python 2.6 compatibility.

struct in 2.6 does not support bytearrays.