media: Silence an analyzer complaint; clean up code

The static analyzer is complaining about a memory leak when we create
this unique pointer. This appears to just be a case of the analyzer not
properly modelling returned temporaries.

While I'm in the area, unique_ptr<T, decltype(free)> is generally an
antipattern: if we instead use an empty struct with an attached
operator(), the unique_ptr shrinks to sizeof(void *) bytes (instead of
sizeof(void *) * 2), and the compiler no longer has to indirectly call
free().

As luck would have it, this small refactor makes the analyzer stop
complaining about this code.

Bug: None
Test: Ran the static analyzer. It's happier, and this builds.
Change-Id: I0c98860e2169ceb8e9d21e577cad89d1ef2c6ff9
2 files changed