Fix trailing newlines in generated patch files.