Fix BufferOverflowException when merging dexes

Bug: 11519714

The bug was due to the fact that when merging 2 dexes, not enough size may be reserved for the "typeLists" section.
This is because we only aligned the sum of the size of both sections.
If both typeLists sections were aligned with 2 and not with 4, we are 4 bytes short when writing.

Change-Id: I73b51eb25434a622143011741a69b88d42507f43
Add tests about dx multidex options.

Change-Id: Ib41d9970976fd8e96b4b2c2d900b123d13965082
am 64909d64: Merge "Add interface for updating process state."

* commit '64909d642aa83370f2e39469d1c5bc3303624a61':
  Add interface for updating process state.
am b2ff8010: Merge "Dalvik: Ensure that the array length complies with the final specifier"

* commit 'b2ff801042b2be5b10e70a3817a9ea8d0b8e9273':
  Dalvik: Ensure that the array length complies with the final specifier
Merge "Add tests about dx multidex options."
Add DexMerge stress test

Also add use of DexIndexOverflowException

Change-Id: Ibe721d026ec7a4a26280701f45369f3d271130ce
Merge "Add DexMerge stress test"
am bb65289d: am 4afbba6e: Fix BufferOverflowException when merging dexes

* commit 'bb65289d09414031efcdb74cdb93148c3aed100d':
  Fix BufferOverflowException when merging dexes
am 1c970695: am ff643a71: Merge "Fix synchronization when preparing ids." into klp-dev

* commit '1c97069522452e768db585d105f3d468dce83329':
  Fix synchronization when preparing ids.
am be6b441c: am d232cbc9: Merge "Deactivate multi-thread in multi-dex mode" into klp-dev

* commit 'be6b441ca3cf42bde4f19e172bd1810ce0c05539':
  Deactivate multi-thread in multi-dex mode
am 90d2c893: am 0433badc: Merge "Use RETURN_PTR(NULL) instead of RETURN_VOID in newNonMovableArray."

* commit '90d2c89307338597846005d91abc98f776795644':
  Use RETURN_PTR(NULL) instead of RETURN_VOID in newNonMovableArray.
am 6b7a3c1a: am 9f663964: Merge "Remove some ARMv5 cruft."

* commit '6b7a3c1a0cc597a42ea102c3763975aa3a766f07':
  Remove some ARMv5 cruft.
am b432c9b4: am 0a09de93: Merge "Remove the sole reference to __ARM_HAVE_BLX."

* commit 'b432c9b4680bf81971ed1c9e6b42915e181b855a':
  Remove the sole reference to __ARM_HAVE_BLX.
am edae3123: am ad7a71d1: Merge "Use libziparchive for dalvik zip processing."

* commit 'edae312355f31d76beac80406f48542b5ef9569a':
  Use libziparchive for dalvik zip processing.
am 43f46b8d: am bbc00477: Merge "Fix libutils dependencies for dexdump & dexlist."

* commit '43f46b8d00611c8df32efcabedae7619d2fe1bc2':
  Fix libutils dependencies for dexdump & dexlist.
am 3d65ac73: am fd154858: Merge "Retry mount() if it fails with EINTR"

* commit '3d65ac73b7ddf12d7c2611d6eb8df995bb235f97':
  Retry mount() if it fails with EINTR
am d6042c76: am a2014f26: Merge "Revert "Use libziparchive for dalvik zip processing.""

* commit 'd6042c76128812a285bdd6f1e52e95f667a6b04a':
  Revert "Use libziparchive for dalvik zip processing."
am b4553571: am 254d5a29: Merge "Revert "Revert "Use libziparchive for dalvik zip processing."""

* commit 'b4553571fe0c81fd2f6a590cf7b0e87b3b3fe49c':
  Revert "Revert "Use libziparchive for dalvik zip processing.""
am 640f31c3: am ff3f62b4: Merge "Fix a few bugs introduced by the move to zip_archive."

* commit '640f31c39f163b574f5b6d4bb93e642a18826ae8':
  Fix a few bugs introduced by the move to zip_archive.
am 3db7ab41: am 55d361a5: Merge "Fix libutils dependencies for dexdump & dexlist (again)."

* commit '3db7ab414ffeb0d397330a9b79408597e33a2e49':
  Fix libutils dependencies for dexdump & dexlist (again).