For certain APIs, the return value of the function does not distinguish
between failure (which populates errno) and other non-error conditions
(which do not set errno).
For example, fgets returns NULL both when an error has occurred, or upon
EOF. If errno is already EINTR for whatever reason, then
RetryAfterSignal(nullptr, fgets, ...);
on a stream that has reached EOF would infinite loop.
Fix this by setting errno to 0 before each attempt in RetryAfterSignal.