General cleanup; add support for key-value pairs

Encoding of key-value pairs follows strategy described in
go/statsd-socket-doc.

Fixed bug where timestamp and atom id were not contributing to the
number of fields in the buffer.

Note: Similar to ag/9603344, which was abandoned because of git rebasing
issues.

Test: m -j libstatssocket compiles
Bug: 143079361
Change-Id: I15abdf13ad8debf83ae1f6c372676db4fe390289
Merged-In: I8d23ddf2dbfee518ad970894ac09ba3ad5b5b4ad
2 files changed