Strip trailing whitespace on write.

I hadn't added this in the past because I guess I thought there might be
a time when I wanted trailing whitespace. That time still hasn't come.