only stop nodeAgent if it has started

When process exits, stop nodeAgent only
if it has started