Fix some HandleScope bugs and add corresponding checks

Some places were creating or destroying handle scopes without holding
the mutator lock. This can cause GC crashes if thread roots are being
marked or hprof dumps to also fail.

Also added checks to catch some of these errors.

Bug: 23468617
Change-Id: I1a2d615923484cfc25014967656775c445aa3f1f
5 files changed