Fixed FreeBSD implementation of semaphores