thorium: fix a race condition leading to a SIGSEGV

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