update ThreadSafeMessageBox function to use strCaption

- ensure we use strCaption for printf and fprintf, as before it could
  happen to have an error message in the debug.log, which had no "Error"
  (or whatever) in front
- ensure ThreadSafeMessageBox() uses the same code (when guiref == NULL)
  as noui_ThreadSafeMessageBox()