cleanup after panic

We had this earlier, but I removed it during the interrupt handling refactor. Need to put it back.