Fix memory leak with tabs keyboard shortcuts