Bug 995357 - [Search] Handle OOMs and other browser events

https://bugzilla.mozilla.org/show_bug.cgi?id=995357