In previous versions, during a panic the error message (and backtrace possibly) might not get displayed after a panic. This happened because
they were printed on the alternate screen and after the program exited, the terminal automatically switches to the main screen. hence
the message never gets to be displayed.
This patch fixes this by doing a cleanup before proceeding furthur on the unwinding of the panic
In previous versions, during a panic the error message (and backtrace possibly) might not get displayed after a panic. This happened because they were printed on the alternate screen and after the program exited, the terminal automatically switches to the main screen. hence the message never gets to be displayed.
This patch fixes this by doing a cleanup before proceeding furthur on the unwinding of the panic