build, refactor: Check that Homebrew's qt5 package is actually installed
build, refactor: Check that Homebrew's qt5 package is actually installed

This change unifies Homebrew packages workflow, and does not change
behavior.

Github-Pull: #20527
Rebased-From: c96d1f65a552712f8476269ad64a415717ead50d

GroestlCoin/bitcoin,GroestlCoin/bitcoin,qtumproject/qtum,rnicoll/dogecoin,litecoin-project/litecoin,GroestlCoin/bitcoin,qtumproject/qtum,GroestlCoin/GroestlCoin,litecoin-project/litecoin,litecoin-project/litecoin,rnicoll/dogecoin,qtumproject/qtum,litecoin-project/litecoin,GroestlCoin/GroestlCoin,GroestlCoin/GroestlCoin,GroestlCoin/GroestlCoin,qtumproject/qtum,litecoin-project/litecoin,litecoin-project/litecoin,GroestlCoin/bitcoin,qtumproject/qtum,rnicoll/dogecoin,GroestlCoin/bitcoin,GroestlCoin/GroestlCoin,qtumproject/qtum,GroestlCoin/bitcoin,rnicoll/dogecoin,rnicoll/dogecoin,GroestlCoin/GroestlCoin,qtumproject/qtum