Avoid visiting find array class cache as roots

If we visit the find array class cache as roots it will prevent
unloading for any array classes in the cache. This is not ideal
since it may take a long time for the entries to get replaced.

Also added a missed exception check in getDeclaredClasses.

Bug: 22720414

Change-Id: Id34557fd034b3e3967ef629301ee251931937849
2 files changed