Added mach semaphores. Improved error logging on mach/posix.