Don't try to use incompatible system libwebp

Make the config test check compatibility more thoroughly.

Task-number: QTBUG-42850
Change-Id: I0771ee633868ad9a7ef03eee2434504d40bc9ce4
Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>