Fix buffer underflow in ApplicationManagerTest

Asan uncovered this. In these tests TestContext is created on the
stack, but the objects that end up using TestContext may be destroyed
after the function, resulting in the buffer underflow.

BUG=438734
TEST=none
R=davemoore@chromium.org

Review URL: https://codereview.chromium.org/776343002