Correctly encode negatives in int32 and correctly decode uint32

- negatives in int32: According to protobuf specification an `int32` type should be able to hold negatives (though not efficiently). It might be rare if someone will use `int32` for negative values but it should still work.

- uint32: Any bitwise operation (with the exception of `>>>`) in Javascript will convert its operands to _signed_ int32 (this is what happens in `varint.read()`). So we need to convert the value back to unsigned if the value type is `uint32`.