loci: add of_object_truncate

This code is taken from IVS which will eventually use the loci version. When
we're reusing an of_object multiple times to reduce the number of allocations,
and we're appending to it, we have to reset its length to the original to
prevent it from growing forever.
diff --git a/c_gen/templates/of_object.h b/c_gen/templates/of_object.h
index 0ca415b..804e7ec 100644
--- a/c_gen/templates/of_object.h
+++ b/c_gen/templates/of_object.h
@@ -100,6 +100,8 @@
 
 void of_object_parent_length_update(of_object_t *obj, int delta);
 
+void of_object_truncate(of_object_t *obj);
+
 struct of_object_s {
     /** A pointer to the underlying buffer's management structure. */
     of_wire_buffer_t *wbuf;