Fixing HardwareBuffer leak when creating a bitmap

Callers are supposed to close the hardware buffer themselves. Creating
a utility method around this

Bug: 123874711
Test: No more leak warning on device
Change-Id: I2cf215f0646222f63e564a58edab1ffffa396ff3
7 files changed