More elaborate workaround for AMD/ATI glMemoryBarrier.