implement mbtowc directly, not as a wrapper for mbrtowc