emulation: Add support for OSC 1?1[017] (fg, bg, highlight colors)

https://bugzilla.gnome.org/show_bug.cgi?id=567444
debug: Fix segfault