Properly detect the presence of certain symbols in the target sysroot.

Instead of guessing that a given android sysroot will or will not
contain a specific symbol, we can just run a series of tests in cmake
and set the appropriate pre-processor defines to enable or disable our
fallback wrappers at compile time.