Fix readVarInt length calculation causing unintended type coercion

Tracked this down while seeing performance issues parsing packets, 68% of the time was spent in readVarInt (coercing the buffer to a string), with the fix only 0.04% :)