[framework] Add check that classpath is up to date to getDexOptNeeded

Bug: 62269291
Test: manual, install new apk/splits and force updates.
I used com.android.cts.classloadersplitapp as the test app.
1) install-multiple split apks with dependency: Base -> A -> B
2) push an update for A
3) adb shell cmd package compile
4) check that A & B got recompiled and that B was because a class loader
context mismatch (e.g. "ClassLoaderContext classpath element checksum
mismatch for position 1.").

Change-Id: I4092562966413dc8976c9d41b26a90bbb9e37e1e
2 files changed