Fix CMake detection of various cmath functions, and XFAIL the test on platforms that are known to be missing them.