patch 8.0.0933: terminal test tries to start GUI when it's not possible

Problem:    Terminal test tries to start GUI when it's not possible.
Solution:   Check if the GUI can run. (James McCoy, closes #1971)
diff --git a/src/testdir/test_gui.vim b/src/testdir/test_gui.vim
index f044f3a..427bab7 100644
--- a/src/testdir/test_gui.vim
+++ b/src/testdir/test_gui.vim
@@ -1,6 +1,7 @@
 " Tests specifically for the GUI
 
-if !has('gui') || ($DISPLAY == "" && !has('gui_running'))
+source shared.vim
+if !CanRunGui()
   finish
 endif