gluegen: avoid bugs with sign-extension in readUInt16

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>