Terminal: fix handling utf-8 characters in OSC commands

Process the Operating System Control command in multibyte-aware way.
That fixes corresponding behavior for latest versions of Midnight
Commander;