Add guard clauses/sanity checks.

* Add guard to prevent 'zombie' processes.
* Add guard against stopping server without first starting it.