use correct bufferData method when passing a NULL pointer

It's not uncommon to pass a NULL pointer to glBufferData to invalidate the current buffer before updating parts of it with glBufferSubData:

http://www.opengl.org/wiki/Buffer_Object#Invalidation

In this case, we shouldn't upload a new buffer.