replacing useGUI flag with getenv("DISPLAY")

Some guys on the Qt IRC channel suggested this fix for our QApplication/QCoreApplication check for display issue. @imaus10 tested it on our linux display-less server. @caotto @sklum ok with you?