add client_flush () before glFlush and eglSwapBuffers

flush the command buffer before sending glFlush and eglSwapBuffers.
The logic behind it is that if the command buffer is full, it means
the GPU side cannot keep up with the CPU speed.  If we continue
sending glFlush/eglSwapBuffer as async, we loose align CPU and GPU.
This is especially evident in GPU bound application.

For example, if in normal case, the app is only 10 fps, because we
use async frame terminator (glFlush/eglSwapBuffer), we can chunk out
30 fps (for example). This means when app terminates, GPU is way behind,
and must finish all previous command before it receives shutdown message.
This is not desirable.  For GPU-bound application, we have to observe
GPU speed.