:bug: Fix exception when closing tab

When tab was closed, sometimes exception "This TextEditor has been
destroyed" is thrown. It happens when @editor is destroyed and we try to
call @editor.markBufferRange method.