Fixes #1687 by extra semaphore retval handle code for OSX

See https://github.com/minetest/minetest/issues/1687#issuecomment-56830173