intel: Protect bufmgr objects with a pthread mutex.

We want to be able to use the bufmgr from multiple threads for GL, and thus
we need to protect the internal structures.

The pthread-stubs package is used so that programs not linked against
pthreads get weak symbols to stubs and don't eat most of the cost.
5 files changed