Fail if java path search finds an Apple framework

One of the ways the launcher attempts to locate a JRE is to look for
where in the PATH the "java" command comes from, including tracing back
through symlinks. Unfortunately, on OS X, this often ends up in the
Java Framework's Commands folder rather than in a proper JRE structure.
Use create_java_vm code on OS X for non-Apple JVMs

Previously, the create_java_vm method excluded the bulk of the logic on
OS X, period, assuming that if we are running on OS X then we will find
and use an Apple JVM only.

However, on newer versions of OS X (particularly on OS X 10.9
Mavericks), all the Apple JVMs are removed by default, and the JavaVM
framework is no longer in place to support them. That is, in
/System/Library/Frameworks/JavaVM.Framework/Versions there is no longer
a '1.6' or '1.5' folder, and instead only 'A' with a 'Current' symlink
to 'A'. So all the logic in set_path_to_apple_JVM fails and the function
fails with a "Could not access Java VM" error.

Since we now return an error code for this situation, we can test for
it, and then continue to the non-Apple-specific logic in that case,
rather than always falling back to system Java.
Respect JAVA_HOME on OS X

If the call to set_path_to_apple_JVM succeeds (i.e., returns 0), that
means we found an Apple JVM. But when JAVA_HOME is set, we do not *want*
that Apple Framework JVM to be used, but rather would prefer to use the
JVM indicated by JAVA_HOME.

So let's make set_path_to_apple_JVM return a failure code if JAVA_HOME
is set, so that we can proceed with the non-Apple-specific JVM logic.