Remove trailing whitespace, and always add a newline to the end of the file.