Add is_erestart helper function

* defs.h (is_erestart): New prototype.
* syscall.c (is_erestart): New function.
* time.c (sys_nanosleep): Use is_erestart,
temporarily_clear_syserror, and restore_cleared_syserror.
diff --git a/defs.h b/defs.h
index 119f9b4..b7e0080 100644
--- a/defs.h
+++ b/defs.h
@@ -538,6 +538,7 @@
 extern int get_scno(struct tcb *tcp);
 extern const char *syscall_name(long scno);
 
+extern bool is_erestart(struct tcb *);
 extern void temporarily_clear_syserror(struct tcb *);
 extern void restore_cleared_syserror(struct tcb *);