Change CTF Writer memory management functions to a get/put model

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