Replace refcounting functions with buffer free

libGralloc4Wrapper currently exposes reference retain and free functions
which call into Gralloc's internal reference-counting mechanisms.  These
actually aren't necessary: the only thing that clients need is a function
that undoes the effect of importBuffer() on a locally-created buffer.

Removed ::retain and ::release, and instead added freeImportedHandle(),
which calls freeBuffer(), unregistering the buffer, and then also
manually unmaps the buffer's handles (which is necessary because
freeBuffer() doesn't normally do that).

Bug: 193573573
Test: many photos with rear and front camera
Change-Id: Iba339d35279512d75da01388c294e6c2191ede6a
3 files changed