Fix segfault at end of simulation.

Happens when msg_global is NULL, and only with MSG_USE_DEPECATED.