When allocating a TlvObject, initialize it.

Since we were sending msg as NULL to _build, it was not initializing the
TlvObject as we intended.

Signed-off-by: João Sampaio <jpmelos@gmail.com>
Free a dynamically allocated string.

Signed-off-by: João Sampaio <jpmelos@gmail.com>