add_message: Fix memory leak of thread_ids GPtrArray.