Preserve original encoded certificate bytes.

Sadly, the publicly visible android.content.pm.Signature object needs
to return the untouched bytes from the parsed APK certificate.  Since
some CertificateFactory implementations may try re-encoding the
certificate, we defensively keep around the original encoded bytes
and return them when asked.

(cherry-pick of commit 0c990ab4a90b8a5492a67b2b728ac9a4a1ccfa1b)

Bug: 18206852, 18228011
Change-Id: I6016eaea23a7f43cf9249ec43cfde1f8ed4ff841

(cherry picked from commit 6632d8c9d8d1a3ac338d541676148677641bafe3)
luni: Disable strict aliasing unless explicitly told otherwise.

(cherry picked from commit 7f6e1632d7cb401ceca2eb27f42e672b40fe2f9d)
Only allow once GC request at a time.

There is no reason to allow multiple, allocating threads may have
multiple GC requests before the GC starts.

Bug: 17942071

(cherry picked from commit 71891f9da2fbcb865931da70ae759032e6698106)

Change-Id: I5e2162373bcef1027eb71e5b1699186ff015f92d

(cherry picked from commit 24f26b3c3fadeb7f19478550f1228bc8396f7410)
Only allow one requestGC at a time

Fixes possible deadlock caused by Thread.getAllStackTraces

Thread.getAllStackTraces suspends all of the threads. If one of
the threads is a thread which holds the GC daemon lock then we
may deadlock when we allocate the stack trace. This happens if we
get a concurrent GC request when we are allocating the stack trace
elements. To fix the deadlock we now only allow a single thread to
requestGC at the same time.

Credits: yamauchi, hboehm

Bug: 18661622

Change-Id: Ia25598e5daa8ff2dc3aa976148d5ff6afa6960f0

(cherry picked from commit 44195e7fc5dcbe4dc7e96d910adefb6d23c488bc)
Move GC daemon locking logic into heap

Fixes deadlock caused by acquirng the mutator lock while
synchronizing on the daemon thread.

Bug: 18739541
Change-Id: Ib3ac3788081d3d471195a6e3a8ed163237616a4f

(cherry picked from commit a482d5ec0fa56ba3dad0f10a4fe1b5519519a81a)