Add support for building on Android
Handle 64-bit offsets correctly on Android
Call exit instead of abort on unhandled errors

 * Abort will show us a very scary stacktrace on Android under some
   situations such as a card being ejected. Call exit(-1) instead.