Write packet ID as a varint