Add sanity checking to declaring class visiting

When we have an unmarked declaring class in the image, it will
SIGSEGV due to the bitmap being read-only. Print some useful
info to try and debug this.

This probably hurts performance a bit, TODO disable when the bug is

Bug: 27493510

(cherry picked from commit b33b1dc78d178060ff0f4327d448fd3a89df51de)

Change-Id: I0c25afd5a6101a71fa1494e12dc019ba64bf43be
3 files changed