Synchronize framebuffer textures on different contexts
If a framebuffer's texture is read on a different context to
the one it was written on, then it needs synchronizing first.
This patch introduces a glFenceSync at the end of every render pass,
and calls GlWaitSync just before the texture is bound for a draw call.
The fenceSync is removed after 2 frames, as it cannot be re-used.
Unused fences are deleted at the end of the frame they are created.
Change-Id: I8ca2e7583836132f879d939377ed46c0b8a56556