make ServiceState more robust to termination while waiting for service
Merge pull request #32 from T045T/patch-1

make ServiceState more robust to termination while waiting for service