Fix signal handling on Windows