Fix dex location of boot oat files during preopt

Dex location should reflect the path on target when preopting
on host. This previously did not hold and this patch fixes the
issue. Other paths remain the same as before. A DCHECK is added
to class linker to guarantee that -Xboot-classpath-locations is
not ignored.

Simultaneously it refactors the logic for resolving a relative
path to make it clearer which path is used for opening files
(dex file name) and which reflects the location on target (dex
location), as these differ when preopting.

The patch also adds a missing dex2oat dependency for oat_file_test.

Test: test-art-gtest-{host,target}-oat_file_test
Test: compiles, no DCHECK crashes
Change-Id: I0629c7ee505b5fd50649800bb3e08efc1ee44102
7 files changed