Flush QemuPipeStream when needed

Under some circumstances, close color buffer messages in the command stream
do not reach the host as the size of the undelivered commands is small.
This results in refcounts of ColorBuffer never dropping to zero and color
buffers not being freed.

The patch calls flush at the end of rcCloseColorBuffer_enc().
In addition, the stream is flushed before it is deleted in the destructor of
QemuPipeStream, since it may also have important messages.

bug: 9278661

Change-Id: I46f20af8e0c272ec8d831d62f57cb2f22c7b28a7
2 files changed