Track syscalls that may restart by -ERESTARTSYS.

Another chunk of #363.