Fix CMake CMAKE_REQUIRED_FLAGS handling to preserve existing CMake flags required by Emscripten toolchain.