script: check that stdin is a terminal

Signed-off-by: Karel Zak <kzak@redhat.com>