Finish fixing Zygote descriptor leakage problem

In order to prevent Zygote descriptors from leaking into the child
environment, they should be closed by the forked-off child process
before the child switches to the application UID.  These changes close
the descriptors via dup2(), substituting a descriptor open to
/dev/null in their place; this allows the Zygote Java code to close
the FileDescriptor objects cleanly.

This is a multi-project change:	dalvik, art, libcore, frameworks/base,
and external/sepolicy are affected.  The CLs need to be approved
together, lest the build break or the software fail to boot.

Round 2: use proper type (jsize) for iteration variable;  whitespace.

Round 3: indentation.

Bug: 12114500
Change-Id: I31d25831b477b076d980c531d57773f9c8c83261
verifier: Bypass monitor-{enter,exit} depth checks

Per Google Bug 61916[1], the monitor-enter and monitor-exit checks in
dex2oat are excessively strict and will reject some valid APKs, such as
WhatsApp[2].  This change attempts to relax those requirements.

[1] https://code.google.com/p/android/issues/detail?id=61916
[2] http://forum.xda-developers.com/showthread.php?t=2525044

Amend from OmniROM: Add a proper ifdef variable that can be
toggled in Android.mk (-DWORKAROUND_BUG_61916)

Change-Id: I19ed1076b124b56ee158ede569fa26ac33910e1c
Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
4-byte align 64-bit values in Get/Set Double/Long for GCC 4.8.

Bug: 10837416
Change-Id: Ibb562407d81c2085666ae8824e7570f22e56eaa7
Fix NewLocalRef, NewGlobalRef to handle cleared weak globals.

We were not checking for null after decoding the reference, this
meant that we incorrectly created null weak global references instead
of returning null.

Issue: 63929
Change-Id: I9159682e6edad8f415ef8144fc13b9aedd2cceb4