Fix a couple of bugs with conditional restart.
Fix a couple of bugs with conditional restart.

scalyr/scalyr-agent-2,scalyr/scalyr-agent-2,scalyr/scalyr-agent-2,imron/scalyr-agent-2,scalyr/scalyr-agent-2