Fix race with LOS Begin() and End()

There was a race for the first large object allocation that cause
callers of Begin() and End() to see a null End() and non-null
Begin(). The fix is to hold the lock and get both Begin() and End().

Bug: 32387879

Test: test-art-host CC

Change-Id: I6173bf3a55d3ba017ffa5b5e9f566025c65b7555
4 files changed