Avoid unnecessary copy in vim_replace_termcodes