Move logic to get profile class descriptors to profile info

Move and simplify logic used to get a descriptor set for app image
creation. Code is covered by TestLayoutAppImage in dex2oat_test.

Motivation:
If we are class unloading in dex2oat, we won't have all the dex files
registered at once.

Bug: 63467744
Test: test-art-host

(cherry picked from commit 4f342b01a9d6661261a233d2221ae4a3c4e6ac4b)

Change-Id: I8bcd268d9fc880d8218b2976f7e35432ae8a18e7
5 files changed