memory: add code to check double free calls

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