Close down export properly when the sidebar is closed.