Preserve traceback when an exception is thrown from background thread.