Check for fd readability in a way compatible with Linux's bizarre treatment of pipe EOF.