Make sure any whitespace of \n characters are removed from filepaths.

Fixes the problem whereby ini files that are symlinks cannot be parsed on Ubuntu.