add posix semaphore test suite

Port FreeBSD test suite, remove tests specific to FreeBSD
implementation, and modify tests that do not comply with the standard.

A next step could be to integrate this test in dfregress(8).

Obtained-from:   FreeBSD