Check pipeline is valid. See g-truc gl-320-caps

* If no program or pipeline is bound, need to make sure we don't try and
  query a non-existant pipeline. This could happen if e.g. state is totally
  cleared at the start of the frame.
Handle when offset is beyond buffer size or length ends up 0
Handle integer and normalized vertex attributes properly
For glVertexAttrib*Pointer, serialise GL_ARRAY_BUFFER

* When glVertexAttrib*Pointer is called it 'latches' the current binding
  of GL_ARRAY_BUFFER (it sets the attrib binding and vertex buffer on the
  VAO internally).
* So when reading, we haven't serialised all the buffer bindings, so we
  need to bind the right buffer by hand.
Add a couple more buffer creation flags
Handle GL_FLUSH_EXPLICIT buffer maps. See g-truc gl-320-buffer-update

* The general idea is that while idle we can handle these as normal -
  If we ignore the map we ignore the map and mark the buffer dirty etc.
  This is fine because modified but unflushed regions become undefined, and
  we just let these become the modified values.
* While capturing a frame, we do everything to set up as normal, but then
  instead of comparing the modified shadow buffer to an unmodified version,
  detecting the modified range and making one big Unmap() chunk, we make a
  chunk per Flush() call with the flushed range, and ignore the unmap.