A simple spinlock replacement for pthread mutexes for existing binaries