Also pass-through glXChooseFBConfig (for SDL contexts > 3.0)
Fetch initial buffer contents for dirty resources in GL

* Huge hack, but it works for now...
Simple tracking of active context per thread

* Should change this to TLS
Add global lock on all GL hook entry points

* This could be improved and moved further down, not all functions would
  need a lock (only things modifying shared resources), but it suffices
  for now.
For VAOs, track and deduplicate redundant chunks

* This is really a spot optimisation but I have a feeling it might be
  useful for more programs.
* If a program uses a single VAO and updates the attrib pointers/enables
  and disables them, then this will prevent an unbounded number of chunks
  building up pointlessly while READING and pushing into the record.
* A 'better' fix for this would be to gather pointer/enabled state as
  initial contents and not tracking any of this except for in CAPFRAME,
  but that isn't happening at the moment.
Change GLResource tuple to be three components including Context

* This lets us distinguish framebuffer object 1 on context A from
  FBO 1 on context B.
* At the moment we assume that all shareable objects are shared between
  all contexts. I think this is sensible and fairly common, but it will
  break if some contexts don't share as the objects will alias.