check for exit condition before transport reconnects

Per the suggestion in #42