make ServiceState more robust to termination while waiting for service