rewrite rwmutext unittest

- use semaphores to control thread progress
- test different reader/writer scenarios and
  policies