Ported from https://github.com/bitcoin/bitcoin/issues/18602. `bitcoin-qt` will fail if it does not have access to a functioning X display, even though when run with `--help` it doesn't need one.