cmake: Fix --build crash on bad CMAKE_GENERATOR in cache

If we fail to create the generator named by CMAKE_GENERATOR, exit
with an error message instead of crashing.  While at it, fix the
wording of the error message when CMAKE_GENERATOR is not set.
Merge topic 'fix-build-crash-on-bad-generator' into next

c1d30ed6 cmake: Fix --build crash on bad CMAKE_GENERATOR in cache