Fix a potential(observed sometimes) media server crash

The problem is that we are referring an temp object returned from a function call.
When the function call returned, the temp object is gone; and thus the reference
may be invalidated.

-- rebased

bug - 2734946

Change-Id: I1993c4462df95610ca478f816adc30058af5850e
1 file changed