flush stderr in uncaught exception handler