Automatically close all panes when exiting the app