Remove trailing whitespace when saving text files