move message destroy at the end

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