Issue reported by @TheBlueMatt in #10110
This is an alternative to the fix in #10113. Instead of modifying test_bitcoin-qt to try to detect whether it's possible to run GUI tests with a check that is probably not reliable, it just adds a --skip-gui-tests option that can be controlled externally. Then, it uses autoconf checks to see if passing the option is necessary.