Revamp dexlayout writing functions

Added some stream abstractions to make it easier to split apart
the main part of the dex file compared to the data one.

Moved to using a vector based stream instead of a mem_map one.

Motivations:
Make it easy to separate data into a separate stream for multidex data
deduping.
Remove upper bounds on dex expansion that would SIGSEGV if the writer
went over the limit.

Bug: 72051652
Bug: 63756964
Test: test-art-host

Change-Id: Ic622a4142b161566d149166a1767434ff4cc7fec
12 files changed