Be defensive in dex2oat when updating the vdex in-place.

Invalidate the vdex header before doing any writing, in case
dex2oat gets killed in the middle.

bug: 38113240
Test: test.py --speed-profile
Test: test.py 629-vdex

(cherry picked from commit 36930eca8cd6ed2bb78da0c1d013db6a92d80670)

Change-Id: I95c1f0a7b56646a9fbd0e0264ef698a44d79c474
3 files changed