Add some tests for options in mutex/lwmutex.

And also update the lwmutex tests a bit.
Move the semaphore tests into a shared directory.
Add tests for semaphore create options.