Making semaphore functions inline, removing null pointer check in enter_semaphore