update /etc/hosts on rhel 7

the previous fix for #4465 assumed that the NetworkManager takes care of updating /etc/hosts with
the new hostname, but testing shows it doesn't. This change ensures that the change is always added
to /etc/hosts when the name changes.
Merge pull request #4527 from Asquera/bugfix/4465-host-not-added-to-etc-hosts

Fix #4465 update /etc/hosts on rhel 7 and derivatives (CentOS)