Fix handling of Ctrl-C

This fixes issue https://github.com/niXman/mingw-builds/issues/142