Add check that classpath is up to date to getDexOptNeeded

Extend getDexOptNeeded to factor into the decision the expected class
loader context. If the context does not match, oat file assistant and
dexoptanalyzer will advise kDex2OatFromScratch.

Note that this does not currently extend the java side
DexFile.getDexOptNeeded. The calls coming from the java side will continue
to ignore the classpath checks by passing null as the class loader
context.

Bug: 62269291
Test: m test-art-host
Change-Id: Ia01728c06810e418bbcbfe2a774d1f904d2525ba
8 files changed