dos2unix: improve test by reusing pathname and checking all output

Closes #28254.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>