Set default CMake build type correctly

The previous setting was overriding user-specified build type so it was
always Release.

Now the user may specify the build type with e.g.
-DCMAKE_BUILD_TYPE=Debug

There are some asserts failing in debug mode currently that will need to
be fixed...