The char msg[] is accessed from outside the main thread after it has exited, so it needs to outlive it. Fixes #717