Use fileinput instead of sed.
Merge pull request #15 from pre-commit/cross_platform_trim_trailing_whitespace

Use fileinput instead of sed.