Disconnect and delete pending commands on reset

* If an exception is raised in the Ruby process, it's possible for Reset
  to be sent to the server while the previous command is still running.
  This ensures that pending commands are stopped when handling Reset.
Make FindModal synchronous

* There's no need to poll for the modal when we have an event loop.