CheckPrototypeDefinition: Avoid if() auto-dereference

Convert from the old if(MATCHES) hack to if(DEFINED) to check whether
the result variable is already set.
Tests: Fix CMP0054 warnings

Hack the CMP0054 warning locally to be an error and run the test suite.
Resolve CMP0054 in Tests/* code as appropriate for each case.
Merge topic 'self-CMP0054-cleanup' into next

fa7d47ac Tests: Fix CMP0054 warnings
3b5ea54a CheckPrototypeDefinition: Avoid if() auto-dereference