cli: Don't fail when there is no tty

Currently we always try to open the /dev/tty device, but this will fail
in environments where there isn't a terminal available, like when
running from a cron script. This patch changes the CLI so that it won't
crash in these situations.

Change-Id: Ie68152e171248b5b18296773b2cd5acaf98d34f3
Bug-Url: https://bugzilla.redhat.com/1119412
Signed-off-by: Juan Hernandez <juan.hernandez@redhat.com>
(cherry picked from commit a2e573477e38bdc2ba4b3c778f4b69b3928d57cc)