rewrite rwmutext unittest

- use semaphores to control thread progress
- test different reader/writer scenarios and
  policies
Merge pull request #585 from dawgfoto/rewriteRWMutexTest

rewrite rwmutext unittest