I may have found the problem.
In the MCPO library:
mcpo->shutdown() calls for gracefulLeave(0)
and delete mcpo stops all the timers.
I think the timers should be stop in shutdown after gracefulLeave(0). Therefore when we call node->leave(), the mcpo heartbeat and maintenance are stopped and won't generate a segfault.
Let me know if that's correct or if I misunderstood the process of MCPO.