print the traceback when an exception occurs in a worker thread or process