message: fix: only call signal if executing on the main thread
diff: @@ -26,6 +26,7 @@ import re
  import signal
  import smtplib
  import tempfile
  +import threading
  import traceback
  import uuid
  import zlib
  @@ -631,6 +632,7 @@ class timeout: # pylint: disable=invalid-name
  def __enter__(self) -> None:
  try:
  + if threading.current_thread() == threading.main_thread():
  signal.signal(signal.SIGALRM, self.handle_timeout)
  signal.alarm(self.seconds)
  except ValueError as ex:
  