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
Merge pull request #763 from LudwigOrtmann/issue_717

move global char array out of thread