libedit: improve multibyte support
Until this commit libedit only supported UTF-8 for multibyte charset
Improve it to support other multibyte charsets
Tested with eucJP and SJIS charsets.
Note that this change as been review and committed in upstream libedit
as well via christos@NetBSD
Submitted by: naito.yuichiro _at_ gmail.com
Reviewed by: bapt, pfg, yuripv, 0mp
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D17903