awaken text editor thread if there are dirty editors when sleep() called

If there are dirty editors when *TextEditorThread.run* calls *TextEditorThread.sleep*, the latter will never return, because it only sets *textEditorResolve* if there aren't dirty editors, so it doesn't set it, and thus *wakeTextEditorThread* doesn't call it.

That means it's possible to hang *TextEditorThread* forever by racing *TextEditorThread.run*: enter two characters quickly enough that the second one triggers a call to *wakeTextEditorThread* (which pushes the editor ID onto *dirtyEditors*) before *TextEditorThread.run* processes the first character and calls *TextEditorThread.sleep* again.

The fix is trivial: simply call the promise's *resolve* function immediately if there are dirty editors when *TextEditorThread.run* calls *TextEditorThread.sleep*.