Fix a bug deallocating wrong strings.

When building a TlvObject from outside after parsing a string or
receiving a message from the network (what would cause to.alloc to be
1), we need to set alloc back to 0.

Or else, when we try to free TlvObject, we will try to free memory that
shouldn't freed.
Make C89 compliant compiling with picky compiler.