make ServiceState more robust to termination while waiting for service

Previously, control flow could "escape" from the while loop and try-catch block if the timing of the node shutdown was right.

If that happened, the ServiceState attempted to call the uninitialized proxy, causing a crash.