config: Fix multiple trailing spaces before comments not completely trimmed
config: Add test cases that have trailing spaces before comment chars
Merge pull request #2599 from linquize/config-trailing-spaces

config: Handle multiple spaces that follow a configuration value and precede a comment char