Retry syscalls on EINTR

Most syscalls that can return EINTR aren't retried if they return EINTR. This diff just adds a simple pattern to retry whenever EINTR is returned.