Prune class path classes from profile

Fixes a theoretical case where classes not in the app, but in the in
the class path could have been included in the image. The dex caches
for these classes are not properly handled and need to be pruned.
Not including the classes in the image classes makes sure the that
class linker automatically prunes them and frees the dex cache with
the explicit garbage collection.

Bug: 28452385

(cherry picked from commit 8d26c5967674d2eab21f65eeac9f1adcf88fce38)

Change-Id: Ic33076f0a76cf1ae727c61a340ceaadf9e7e7d08
2 files changed