Encode and write a varint. value is treated as unsigned, so it won't be sign-extended if negative.
value