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.

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