Detect the existence of sys/personality.h in cmake.

Older android native sysroots don't have sys/personality.h. For them, we
need to include linux/personality.h and hack some macros to get the
desired result.
Fix build for android.

Android sysroot headers have a few differences with standard linux like
not having strtoull or snprintf in std::. We can just use symbols from
the root namespace instead.