Ctypes fix

Patches the libffi configure and configure.ac so that we get the right kind of malloc on android.