Well, you should do your utmost best to prevent the situation in the first place (use startup/shutdown behaviour correctly).
I remember I had those problems a lot in the beginning of Zn, especially when running tests that sometimes failed.
Have you seen Zn's #isListening ? I think that was written to catch the case you described, but I am not sure it is 100% rock solid.