filter out trailing spaces and dots from filenames on windows, since they're not allowed