close notification when killed

plus other cleanup on exit