Fix build on macOS due to not having Wayland (variant 2)
Wayland-specific stuff is guarded by #ifdef Q_OS_UNIX,
which also matches macOS.
Replaced with #ifdef HAVE_WAYLAND guard.
The guard is based on a non-standard yet widely available
feature on both GCC and Clang.
This is an alternative solution for:
Bug: https://bugs.kde.org/show_bug.cgi?id=497136
MR: https://invent.kde.org/pim/kleopatra/-/merge_requests/334
Commit: https://invent.kde.org/pim/kleopatra/-/commit/3d7308a7f38a70ab161d6acf621131461a4bb2be