thorium: fix memory leak in messaging system

Link: https://github.com/GeneAssembly/biosal/issues/777
Signed-off-by: Sébastien Boisvert <boisvert@anl.gov>