Fixes #4142: /etc/hosts gets messed up by sed commands

http://www.rudder-project.org/redmine/issues/4142