AMBARI-8615. Fix restarting ambari-agent (aonishuk)