cmake: Fix CMAKE_BUILD_TYPE and OPTIMIZATION_FLAG match check
cmake: Fix CMAKE_BUILD_TYPE and OPTIMIZATION_FLAG match check

The check introduced in #18777 uses incorrect CMake syntax.
IN_LIST requires the list variable name, not its content.

Signed-off-by: Jack Dähn <596727c8a0ea4db3ba2ceceedccbacd3d7b371b8@jkdhn.me>

nashif/zephyr,Vudentz/zephyr,Vudentz/zephyr,zephyrproject-rtos/zephyr,zephyrproject-rtos/zephyr,galak/zephyr,Vudentz/zephyr,finikorg/zephyr,Vudentz/zephyr,nashif/zephyr,nashif/zephyr,finikorg/zephyr,galak/zephyr,galak/zephyr,finikorg/zephyr,Vudentz/zephyr,finikorg/zephyr,galak/zephyr,nashif/zephyr,galak/zephyr,zephyrproject-rtos/zephyr,finikorg/zephyr,Vudentz/zephyr,nashif/zephyr,zephyrproject-rtos/zephyr,zephyrproject-rtos/zephyr