ae-bridge: Remove unneeded declaration and cleanup comments.
ae-bridge: Remove onResize callback, move to native code.

For us, this callback has no effect on screen sizing, because it's
coordinated elsewhere between the core and SDL, and is specified dir-
ectly in the mupen config file.  The only reason we need this callback
is to initialize SDL's internal pixelformat state.  It's much cleaner
to just do this directly from the native side during the startup
sequence.  No need to involve the Java side or the activity/surface
lifecycle stuff.

Note that before this commit, the RGB565 SDL pixel format was always
being called, regardless of the user RGBA8888 setting.  I'm not sure if
the value matters much here; it just can't be the initial value
SDL_PIXELFORMAT_UNKNOWN.
ae-bridge: Check function pointers before invoking them.

During startup, it's possible for one thread to invoke a core method
before the library has loaded and found the function pointer.
front: Fix state machine for game lifecycle tracker.

A bunch of fixes rolled into one.  I had to be hit over the head to
realize there are only three states (not four) in the state machine:
running, paused, stopped.  No such thing as "started" without running.

So the fixes:
 - Transition to stopped ONLY when the surface is destroyed.  Android
   4.3 (and probably others) does not destroy the surface when the user
   presses the power button; it merely stops the activity.  If we stop
   the emulator onStop, then we have broken GL context stuff when the
   emulator starts running again.  That results in lock-ups, etc.
 - When starting to run, we either startupEmulator or resumeEmulator,
   but never both.  Before, we would resumeEmulator immediately after
   startupEmulator, which wasn't necessary and introduces a potential
   race condition later.  Though the race condition is currently miti-
   gated with the function pointer checks in the ae-bridge, it's
   better to just have the correct design to start with.
 - Clean up some internal variables, improve readability (e.g. the
   isSafeToRender function).
ae-bridge: Internalize lib loading and delay unloading.

No need for the Java client to load and unload the libraries.  We can
keep this all internal to the ae-bridge.  Reduces the number of JNI
functions and minimizes complexity.

Also, we don't unload the libraries after the core thread exits.
Instead, we just unload stale library instances during the startup
sequence.  This avoids any potential race conditions between unloading
and the core commands during the shutdown sequence.
ae-bridge: Remove hard-coded library path.
bugfix: Always auto-load state when OS restarts GameActivity.

If the user pressed "Restart" from the Play menu, made progress, and
then was interrupted (home button, phone call, etc.), then when the OS
restarted the activity, all the user's progress would be lost.