Fix profile guided compilation for secondaries and add more tests

The method signature for opening the reference profile was wrong
and did not account to the fact that the profile name can be
null for secondary dex files.

Also, add infrastructure to test dexopt for primary apks and add
an initial set of tests.

(cherry picked from commit 2372d12577540bd41c74f2d1cd6f604a0390d726)

Test: installd_dexopt_test
Bug: 72666394
Merged-In: I537a3f52a1449a8edb070643500a4d241728cb9a
Change-Id: I537a3f52a1449a8edb070643500a4d241728cb9a
2 files changed