Destroy the editor when an EditorComponent is unmounted

Fixes #3222