janus_videoroom: Use GAsyncQueue to prevent message race conditions

The messages queue is accessed from multiple threads (HTTP handler
threads call janus_videoroom_handle_message(), and
janus_videoroom_handler() runs in its own thread), so needs to be thread
safe.
janus_videoroom: Simplify some g_free() calls

g_free(NULL) is explicitly defined to be a no-op. There really is no
need to condition all g_free() calls on NULL.
janus_videoroom: Automatically free unhandled messages on shutdown
janus: Simplify HTTP event management a little

This introduces no functional changes; just gets rid of a load of
redundant code.
janus: Switch janus_session from GQueue to GAsyncQueue

This simplifies locking and memory management.
janus: Simplify iteration over the sessions hash table

Instead of allocating a huge linked list for every value in the sessions
table, just use a GHashTableIter to iterate in-place.
ice: Add a missing mutex unlock on an error path
janus: Tidy up iteration over ICE handles

Use GHashTableIter instead of copying the table into a new linked list.

This changes janus_ice_handle_destroy() to not remove the handle from
the session — the caller must now do that. This simplifies locking on
the session.
ice: Ensure ice_handles is accessed with the lock held
janus: Add janus_session_exists()

This is a more specialised alternative to janus_session_find() which
doesn’t return the session itself. This will simplify reference counting
of janus_session structures when it’s added in a few commits’ time.
janus: Simplify retrieval of session IDs

There’s no need to access them from the session struct when we already
have them in a local variable. This will simplify locking later on.
janus: Add reference counting to janus_session

This is necessary to decouple the sessions_mutex from the mutexes of the
individual janus_session structures. Otherwise, one thread can call
janus_session_find(), retrieve a pointer to the session, and then
another thread can free it. Fix this by having janus_session_find()
atomically return a new reference to the session, preventing another
thread from freeing it.

Threads must still take the janus_session.mutex before accessing any of
the session’s members.
janus: Locking fixes for janus_session

Ensure the janus_session.mutex is held before any of the session’s
members are accessed.
ice: Add janus_ice_handle_exists()

This is a more specialised alternative to janus_ice_handle_find() which
doesn’t return the handle itself. This will simplify reference counting
of janus_ice_handle structures when it’s added in a few commits’ time.
ice: Add reference counting to janus_ice_handle

This is necessary to decouple the janus_session.mutex from the mutexes
of the individual janus_ice_handle structures contained in it.

Threads must still take the janus_ice_handle.mutex before accessing any
of the handle’s members.
ice: Fix locking of janus_ice_handle structures

Accesses to them were only very infrequently protected with a mutex,
leading to all sorts of threading issues, as detected by Valgrind’s DRD.
WIP adding more suppressions to janus.supp

These need checking before I’m happy with this commit.