opengl: rcOpenColorBuffer must be synchronous

The gralloc register_buffer() function, which calls rcOpenColorBuffer,
must actually increment the reference count before returning.
Otherwise the buffer allocator may release its reference before the
client has obtained one, and the buffer will be freed prematurely.
Since rcOpenColorBuffer was just sending a message to the host without
waiting for it to be received/processed, this guarantee was not met.
Adding a return value makes the call synchronous.

Bug: 12988668
Change-Id: I8b2399cfb0f600f99b3387f630343291b59bc9a6
9 files changed