[master] Patch for exceptions in non-main thread in TUI