core: replace some code by calls to function gui_chat_clrtoeol()