Support image classes filtering in image writer

New logic prunes classes that have any dependency on a non-image
class. This enables creating smaller images with class profiling.
Code is from class profiling CL.

Added a CHECK for guarding against creating an app boot image with
existing boot image(s).

Bug: 22858531

(cherry picked from commit 7fccc2de5a7ea1bb8241d50869a2a4e44b35767f)

Change-Id: Idcc1de4367b5368bbbd2881cbd63975a646d0831
2 files changed