thorium_node: use message type to select pool to free buffer

Signed-off-by: Sébastien Boisvert <boisvert@anl.gov>
core: verify if pointer is managed by pool if tracking is enabled

Signed-off-by: Sébastien Boisvert <boisvert@anl.gov>