fixes to be compilable by mingw32

with -Werror
Ctrl-C handler for Windows
Merge pull request #302 from pijyoi/win32_ctrlc

Ctrl-C handler for Windows