Properly remove editor instances when a tab is closed.