diff3: implement --strip-trailing-cr
(cherry picked from commit 54a3415cb69e1ea0e6533ca3fc168deba64f249f)