fix a lot of memory leaks

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