Fix use-after-free issue for dexfile am: 1ee0290eed

Original change: https://googleplex-android-review.googlesource.com/c/platform/art/+/19911435

Change-Id: I170a0e101d779e6897002b477ca4ab51e43111a1
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>