sem_getvalue returns ERROR and sets errno if it fails, we don't want to return OK in this case, we want to return the non-negated error number.