Refactor oat file writing.

Since we're writing dex files to vdex rather than oat files,
we can write them before knowing the oat header size. This
simplifies Runtime creation in dex2oat.

Test: m test-art-host-gtest
Test: testrunner.py --host --optimizing
Change-Id: I6e0fa9ddc6671cff99e70507b67e052df7ad87c3
5 files changed