TextEditor: Fix crash

Introduced in dcba4a271537578e0ac20b4f5a9646d67dba0ad4

Occurs when invoking InsertVirtualMethods to implementation file, which
is not opened.

Change-Id: Icc84d63ddf28312eb77f2666166f609085d81d63
Reviewed-by: Eike Ziller <eike.ziller@digia.com>