Add unicode support for console output on windows

Hints regarding the unicode support were taken from the libuv project, which
really helped.

Also thanks to @ertaquo for the original effort in issue #1063.