Fix crash with secondary dex files on low RAM devices. am: 50419f2d4c am: 3bff7d0496

Original change: https://android-review.googlesource.com/c/platform/art/+/1661964

Change-Id: I8b6af4e6bff5da85b1586f0c66a4a6ccc7f79d46