add spy object to test focus event

fixes remaining issue for #9972 
@redmunds: I don't fully understand why we need this code -- it seems like we'd _always_ want to inform users when one of their JS files causes Tern to spiral out of control, both (a) so they understand their code hints will be degraded, and (b) to encourage them to report a bug to us.

But assuming we do want to hide such errors for whatever file the cursor is currently in, this change seems more correct even for the old CEF, since there are lots of cases where focus may lie elsewhere (e.g. in the Find bar, or window isn't focused) at the moment when Tern times out -- and in all those cases, `getFocusedEditor()` would be null even in the old CEF, obviating this whole check.