[stdin] Detect closed file descriptor