CMakeUtils: Protect against null pointers

Be more defensive against unexpected input for these functions.
'project' might be 0 in some circumstances => crash.

(This happens when quickly shutting down KDevelop after startup)

Backtrace:
Thread 2 (Thread 0x7fcf81dea700 (LWP 10002)):
[KCrash Handler]
5  (anonymous namespace)::baseGroup (project=project@entry=0x0) at
/home/krf/devel/src/kdevelop/projectmanagers/cmake/cmakeutils.cpp:83
6  0x00007fcf83506c96 in (anonymous namespace)::currentBuildDirIndex
(project=project@entry=0x0) at
/home/krf/devel/src/kdevelop/projectmanagers/cmake/cmakeutils.cpp:98
7  0x00007fcf83506dc0 in (anonymous namespace)::readProjectParameter
(project=project@entry=0x0, key=..., aDefault=...) at
/home/krf/devel/src/kdevelop/projectmanagers/cmake/cmakeutils.cpp:109
8  0x00007fcf83506e42 in CMake::currentBuildDir (project=0x0) at
/home/krf/devel/src/kdevelop/projectmanagers/cmake/cmakeutils.cpp:254
9  0x00007fcf81f0ce99 in CMakeImportJob::initializeProject
(this=this@entry=0x2024cf0, rootFolder=0x42ec130) at
/home/krf/devel/src/kdevelop/projectmanagers/cmake/cmakeimportjob.cpp:134
10 0x00007fcf81f0dc43 in CMakeImportJob::initialize (this=0x2024cf0) at