FindOrBuildPackage: Cache HAVE_SYSTEM_<pkg> and HAVE_<pkg> variables

Since these variables are passed to the parent scope, they are lost in
the next parent scope.
This means that if we had a find_or_build_package(A) and the
BuildA.cmake has a find_or_build_package(B), after the first call,
HAVE_B and HAVE_SYSTEM_B are not set, and therefore a later
find_or_build_package(B) call would include the BuildB.cmake another
time and in some cases (depending on the file included) give warnings
about duplicated targets.

By caching the variable, this is available all over the system, and
therefore it fixes this issue.