Support multi-byte characters.

Enhance debugging features.
Add the workaround for lock on Windows (native NTemacs & Cygwin).