Low-memory-footprint mutexes for pthreads