[CMake] Fix PR18987: discard /MD flag if we're adding /MT