change system call restart behaviour: if flag is False, system calls
will be restarted when interrupted by signal sig, else system calls
will be interrupted.