Make color escape sequences conform to terminfo entry

img2xterm had been combining multiple 256color rendition changes in the
same SGR sequence, e.g., `ESC [ 48;5;179; 38;5;100 m` to change both the
background and foreground color.

The xterm-256color terminfo entry requires (and mosh enforces) that
these be in separate escapes. This commit makes the img2xterm output
render correctly in mosh.

Example: `echo -e "setab 179\nsetaf 100" | tput -S | od -c` generates
`ESC [ 48;5;179 m ESC [ 38;5;100 m`.

* https://github.com/thiderman/doge/pull/48
* https://github.com/keithw/mosh/issues/519
* https://github.com/keithw/mosh/issues/110#issuecomment-5053997