Check IsModifiableClass earlier in redefineClasses and retransformClasses

We were not checking this until we actually tried to install the
definition. This meant that we could send dex file data to agents even
if there is no chance of it being used. We would also try to get the
dex file name for non-existant dex files causing crashes.

Bug: 31455788
Test: ./test/testrunner/testrunner.py --host -t 921-hello-failure
Change-Id: I647a057fe916861d555ae142a2961f449f1bc3a5
5 files changed