Fix extra newline at end of hostname for Fedora

This fixes a bug introduced by 138b45e3.
The hostname has an additional newline at the end which leads to the
state always being 'changed: true' even if the hostname is unchanged.
Merge pull request #8307 from robinro/fix-extra-newline

Fix extra newline at end of hostname for Fedora