Explicitly include vector.

Always explicitly include any library headers needed in a translation unit.
Use make_shared.
Mac OS X does not have pthread_spin_lock. Use OSSpinLock instead.
'init_priority' attribute is not supported on Mac OS X.