login: check that after tty reopen we still work with a terminal
* the login code assumes that stdin is a terminal, it's better to
check (by isatty()) that after tty reopen we still have a terminal
* this patch also removes very old obscure fallback for situations where
ttyname() returns nothing (then ttyn = "/dev/tty??"). I guess that the
fake string was originally for utmp records or so. Currently (in last 10
years...) code requires that the tty name is a real open-able file.
It means the fake tty name is completely useless.
Reported-by: Yann Droneaud <yann@droneaud.fr> Signed-off-by: Karel Zak <kzak@redhat.com>