Fix read() trying to access close()ed stdin.