retry.py: check /dev/tty before grabbing it (#1)

If you are running under cron or some other non-interactive mode messing
around with the tty will fail. You can also disable tty messing around
with --notty. The script insists you set a retry limit as having a
non-interactive script run forever is bad manners.