Added tracing for unhandled exceptions in main thread