Fix whitespace and `^M` control characters normally generated by Windows

The original files contain `^M` control characters that usually originate
from editing files in Windows.  The dreaded dos line-endings. These control
characters can cause errors on Linux machines.

Extra whitespace at the end of lines is also removed.

[rbrito: Fixed commit message to have at most 80 characters.]

Signed-off-by: Rogério Brito <rbrito@ime.usp.br>