Fix karma issue

Karma sometimes does not call onBrowserStart and onBrowserComplete.