move global char array out of thread

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