This resolves #535.
OS X 10.12 deprecated OSSpinLock; os_unfair_lock is the recommended replacement.
Add mtx (mutex) to test infrastructure, in order to avoid bootstrapping complications that would result from directly using malloc_mutex. Rename test infrastructure's thread abstraction from je_thread to thd. Fix some header ordering issues.