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

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