Moved semaphore mock code from pthread files to semaphore files