android: crazy_linker: Fix search path handling.

This CL gets rid of the context-specific search path and
Java VM instance in the crazy linker, and moves these to
global variables only.

This ensures that wrapped dlopen() operations use the same
search paths / VM information as the loading operations that
are performed through a crazy_context_t. Doing otherwise
could lead to surprising results (e.g. a dlopen() call
failing because it could not find a library at the right
location, or failing to call JNI_OnLoad() as required).

It is hoped that this fixes some issues when loading
native libraries from bundle DFMs.

crazy_context_t is now a simple holder for an error message
and a load address, but it is simpler to keep it as is than
trying to refactor the rest of the crazy linker API.

+ Fix the crazy_linker_test_jni_hooks test program and its
  associated native library, and ensure they are run properly
  when calling run_android_crazy_linker_tests.

BUG=936001
R=pasko@chromium.org, cjgrant@chromium.org, tiborg@chromium.org, benmason@chromium.org

Change-Id: I222913a83547f9107dde0b568a9a1ba840ecee7f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1499535
Reviewed-by: Andrew Grieve <agrieve@chromium.org>
Reviewed-by: David Turner <digit@chromium.org>
Reviewed-by: Egor Pasko <pasko@chromium.org>
Commit-Queue: David Turner <digit@chromium.org>
Cr-Commit-Position: refs/heads/master@{#637323}
14 files changed