libc - change SEM_VALUE_MAX

sem_getvalue(3) requires a signed int count so change SEM_VALUE_MAX to INT_MAX.

Reviewed-by: joris@giovannangeli.fr
libc - bail out on invalid sem_open(3) flags

Preventing now callers from passing invalid flags prevents compatibility
issue should new flags be added to sem_open(3) in future standard
revisions.

Reviewed-by: joris@giovannangeli.fr
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
Reviewed-by: joris@giovannangeli.fr