Apply patch to use LibEvent with Android NDK

To do this, I used and slightly edited patches created by @ventureresearch.