Make sure \n is at the end of config file before a new section is written
Add unit test to test add section without lf at EOF
Merge pull request #2476 from linquize/config-lf-eof

When adding new config section, handle config file not ending with LF