Fix automatically setting CMAKE_BUILD_TYPE when not set