glthread: move buffer functions into glthread_bufferobj.c