[x11] check text selection for valid utf8 ending.