A couple of fixes on windows.

1. CONIN$ detection doesn't work properly at all. Let's simply assume that if
set_input_mode fails, then the handle is not a console.

2. RuneWidth from mattn's library may actually return 0, which leads to
infinite loop in the prepare_diff function.