fix crash on exit due to order of operations bug in ~RawMonitorResource

The problem (which we've only been able to reproduce consistently with
the openjdk-src process=interpret build on Linux virtual machines) was
a race condition during VM shutdown.  Thread "A" would exit, see there
were other threads still running and thus enter ZombieState, which
involves acquiring and releasing a lock using RawMonitorResource.
Then the last thread (thread "B") would exit, wait for thread "A" to
release the lock, then shut down the VM, freeing all memory.  However,
thread "A" writes to its Thread object one last time after releasing
the lock (in ~Resource, the destructor of the superclass of
RawMonitorResource, which sets Thread::resource).  If thread "B" frees
that Thread before ~Resource runs, we end up writing to freed memory.

Thus, we need to update Thread::resource before releasing the lock.
Apparently C++ destructors run in order from most derived to least
derived, which is not what we want here.  My solution to split
Resource into two classes, one that has no destructor and another that
extends it (called AutoResource) which does hafe a destructor.  Now
all the classes which used to extend Resource extend AutoResource,
except for RawMonitorResource, which extends Resource directly so it
can control the order of operations.
Merge pull request #260 from dicej/resource-crash

fix crash on exit due to order of operations bug in ~RawMonitorResource
Change ByteArrayOutputStream's toString function to match openJDK's expectation
Merge pull request #261 from jentfoo/master

Change ByteArrayOutputStream's toString function to match openJDK's expectation
fix iOS OpenJDK and simulator builds

With the iOS openjdk-src build, sun.misc.Launcher will throw an
InternalError if avian.file.Handler is not present, so let's make it
happy.

Also, as of recent version(s) of Xcode, there are no utilities
(e.g. ar and strip) in iPhoneSimulator.platform/usr/bin, so we can
just use the system ones.
Merge pull request #262 from dicej/ios

fix iOS OpenJDK and simulator builds
Fix package for LegacyObjectInputStream (ammending commit to try to force a travis build)
Merge pull request #264 from jentfoo/master

Fix package for LegacyObjectInputStream
add simple version flag
Add UnknownHostException to proguard config
fix log level inheritance

A Logger which has not had a level set explicitly should inherit its
effective level from its parent, not just default to INFO.
Merge pull request #266 from joshuawarner32/unknown-host-proguard

Add UnknownHostException to proguard config
Merge pull request #265 from joshuawarner32/version-flag

add simple version flag
Merge pull request #267 from dicej/log-level

fix log level inheritance
cleanly destroy MyProcessor to allow for creating/destroying VMs in the same process multiple times
Merge pull request #268 from joshuawarner32/clean-shutdown

cleanly destroy MyProcessor
fix non-Avian classpath build regression introduced in 7a768f2

While Avian's java.util.logging.Handler only has one abstract method,
the standard version has three.
Merge pull request #269 from dicej/handler

fix non-Avian classpath build regression introduced in 7a768f2
don't use GetPrimitiveArrayCritical when throwing SocketExceptions

690ba9c fixed this for throwIOException, but we didn't notice that
throwSocketException had the same problem.
Merge pull request #271 from dicej/socketexception

don't use GetPrimitiveArrayCritical when throwing SocketExceptions