emulation: Refactor color palette handling

https://bugzilla.gnome.org/show_bug.cgi?id=640040
emulation: Add support for OSC 112 (reset cursor color)

https://bugzilla.gnome.org/show_bug.cgi?id=640040
emulation: Add support for OSC 104 (reset colors)

https://bugzilla.gnome.org/show_bug.cgi?id=640040