core: Surround android-specific code with ANDROID symbol.

These might actually be useful to push upstream because they aren't
"hacks" and are generally applicable to any android build (not just
ours).