This commit constitutes a pretty big refactor of the instruments
process handler. It also introduces a server flag, '--backend-retries',
with a default of '3', which specifies how many times Appium will retry
launching instruments before giving up and saying that it crashed or
timed out. This works in concert with launchTimeout, of course.
I think this refactor also fixes some longstanding callback reasoning
errors and maybe some other bugs.
It might also introduce some bugs of its own though :-)