Trap interrupt for cleaner exits