[MERGE] add comments and a session close_flag

Signed-off-by: David Goulet <dgoulet@efficios.com>
[MERGE] cleanup ctf_trace if refcount down to 0

Signed-off-by: David Goulet <dgoulet@efficios.com>