OpenGL/Shapes: pass the correct pointer to CommitWrite()

This bug caused a crash on OpenGL implementations that do not have
GL_OES_mapbuffer (TRAC #3313).
OpenGL/Buffer: add assertions to verify the pointer in CommitWrite()

Don't let TRAC #3313 happen again.