hmm that's true. It could end up repeating on a loop. Maybe we can just have it try to restart once and then give up if it wants to restart again.
A restart is triggered in places wherever there is a call to `fatal` or `fatal_errno` (see _adb.cpp_ for the definition of those functions). It's called all over the place if something bad fails.
I put it in because on OSX I noticed that sometimes there is a failure to read from the phone that causes a fatal to be called (which used to crash Firefox). Restarting in that situation would fix it.

The cleanup code is just to get everything to close without crashing or hanging the browser. The reset suite of methods resets state so that ADB can be started again. I guess it makes sense to move that resetting into the cleanup code though since it's not time consuming.