message: fix crash when PyThreadState_GET()->frame is null
diff: @@ -57,6 +57,7 @@ extern "C" void debug_print(const char* str, int len) {
  string s(print_buffer.data(), print_buffer.size());
  PyFrameObject *f = PyThreadState_GET()->frame;
  + if (f) {
  const char* filename = PyUnicode_AsUTF8(f->f_code->co_filename);
  const char* name = PyUnicode_AsUTF8(f->f_code->co_name);
  @@ -65,7 +66,9 @@ extern "C" void debug_print(const char* str, int len) {
  }
  fprintf(stdout, "%-10s %4d %-20s %-20s %s", buffer, PyFrame_GetLineNumber(f), filename, name, s.c_str());
  fprintf(stdout, "%s\n", CONSOLE_BLACK);
  -
  + } else {
  + fprintf(stdout, "%s\n", s.c_str());
  + }
  print_buffer.clear();
  continue;
  }
  