Enable ptrace on userdebug when JDWP is disabled

r.android.com/2217921 disabled JDWP on userdebug builds by default in
order to avoid the JDWP overhead causing differences between user and
userdebug builds.  This had the side effect of disabling ptrace, which
means libmemunreachable can no longer ptrace app processes, and app
processes are no longer debuggable by gdbserver unless it is run as
root.

Add a new DEBUG_ENABLE_PTRACE zygote runtimeFlag for enabling ptrace,
and set it anywhere DEBUG_ENABLE_JDWP was set before
r.android.com/2217921.  Use the flag to call EnableDebugging.

Bug: 285967712
Test: adb shell dumpsys meminfo --unreachable com.android.gallery3d
Change-Id: I2fb1aa0aea81400f573b8c2e2fa309b7942d9446
3 files changed