Implement cgminer specific cgsem semaphores to imitate unnamed semaphore behaviour on osx which does not support them.
Failed reads and writes on cgsem_post and cgsem_wait should be extremely rare.