Enable userfaultfd selftest

Now that the userfaultfd feature is enabled in the Android kernel, it
makes sense to have its selftest enabled in the test infra.

The test source code required the following changes:
1) Use UFFD_USER_MODE_ONLY as unprivileged processes are not allowed
userfaults from kernel space on Android
2) Use random/initstate instead of random_r/initstate_r as bionic
doesn't support the latter.
3) Since bionic doesn't have pthread_cancel() implemented, we
implemented the same functionality using pthread_kill() and longjmp().

Bug: 160737021
Bug: 169683130
Test: treehugger
Change-Id: Ia369995eacb26fe6fb9c518d409b39d7fcf8d2e3
5 files changed