build: Check for pthreads

We have some lazily initialized global variables in Graphene that get
initialized when retrieving them, and we definitely want to ensure
thread safety when that happens.

Since we cannot unconditionally depend on GLib, we need to do this the
old fashioned way, and implement "thread safe once access" ourselves.

For starters, we add a dependency on pthreads, and use pthread_once_t.

On Windows, we'll use InitOnceInitialize() instead, since we don't care
about supporting Windows XP.
vectors: Conditionally use pthread_once()

We have to initialize the global constant vectors in a thread-safe way.
box: Conditionally use pthread_once

Like we did for the lazily initialized constant vectors, we need to use
pthread_once() to initialize the constant boxes.