cat: cleanup write_tab_to_end duplication of logic
cat: cleanup write_tab_to_end duplication of logic

The logic for '\n' and '\r' about the number of written characters was duplicated

uutils/coreutils,uutils/coreutils,uutils/coreutils