Add an internal reference counting API to the CTF Writer

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>