Revert "ClearMatches: Only clear matches which were actually set" (#15261)

This reverts commit v3.1.0-rc1~557^2~2 (ClearMatches: Only clear matches
which were actually set, 2014-03-12).  The optimization did not track
the match count in the same scope as the variables, allowing possible
inconsistency.

Resolve conflicts in Source/cmIfCommand.cxx, Source/cmMakefile.cxx,
and Source/cmMakefile.h by moving the changes to the new location
of the code involved.
Merge branch 'revert-cached-regex-clear' into revert-cached-regex-clear-for-master

Resolve conflict in Source/cmMakefile.h by integrating both changes.
Merge topic 'revert-cached-regex-clear-for-master' into next

808c77e2 Merge branch 'revert-cached-regex-clear' into revert-cached-regex-clear-for-master
7d674b5f Revert "ClearMatches: Only clear matches which were actually set" (#15261)