fix #2407; Character \# cannot be escaped in settings file

Another fix would be:
<pre>
if (line.Contains('#'))
{
    var commentIndex = line.IndexOf('#');
    var previousIndex = commentIndex - 1;
    if (commentIndex == 0 || line[previousIndex] != '\\')
        line = line.Substring(0, commentIndex).TrimEnd(' ', '\t');
}
</pre>

but this would ignore #bar in next line:
name\\#foo#bar