Fixed en-/decoding of int{32,64} (should be signed).

See https://developers.google.com/protocol-buffers/docs/proto#scalar
Fixed integer encoding on different architectures (32 and 64 bit).

[u]int64 is [unsigned] long *or* long long depending on the word size.
Use inttypes.h macros (C99) to use correct encoding on all architectures.