Don't pass empty profile to OatWriter

Doing so causes dexlayout to run and unnecessarily increases dex2oat
time. This change passes null if the profile is empty to fix this.

Bug: 77719042
Test: test-art-host

(cherry picked from commit cc2cd98c21f77c8ae368988d380827811be2dc9d)

Merged-In: Id663d2cbf32dae57f0b562a1f5263293869727d7
Change-Id: I4599f4784c7d2ac3f5e759249226ca9d155efc31
2 files changed