Update /etc/hosts when linked container is restarted

Carry of #7092

closes #7092
fixes #6350

/cc @vieux
Error message could be more descriptive: `Failed to update /etc/hosts of parent container`.