Fix incorrect dex-cache clearing with structural redefinition

We were incorrectly clearing the dex-cache in some cases after
structural redefinition. Leaving some entries present that should
have been deleted. This could cause subsequently run code to
resolve static methods or fields incorrectly.

Test: ./test.py --host
Bug: 161846143
Change-Id: Idf23fc21f2e396c347861afd070363c509108096
Merged-In: Idf23fc21f2e396c347861afd070363c509108096
(cherry picked from commit bf6498e3d94cde2abbf99788e68e44f48280846a)
9 files changed