Cmake build: Check for string COW by checking for library, not compiler

Changed according to automake behaviour, see 385f3e8abdf9840ba89b502c1c83345e4ca40344