wrap signal handler in try block for windows