Format /etc/locale.gen correctly on gen_locale
Format /etc/locale.gen correctly on gen_locale

Prior to this change, the ``file.replace`` call matches an end-of-line character, which changes a file from:
```
...
# en_US.UTF-8 UTF-8
# en_ZA ISO-8859-1
...
```
to
```
...
en_US.UTF-8 UTF-8# en_ZA ISO-8859-1
...
``` 
which is incorrectly formatted -- the newline char being removed means the whole section after the whitespace is considered the charset.  See http://www.man-online.org/page/5-locale.gen/.

This may fix #24827.

saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt