Move static functions up to access them from get_new_streams

When we detect that the viewer is trying to get new streams for a
session closed and for which it already got all the streams, we can
delete and destroy the session, we know it won't be useful anymore.

FIXME: we should probably when we destroy the last stream of a ctf_trace
(when only the metadata remains).

Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>