Use sigaction and SA_RESTART in read-tree.c; add option in Makefile.