posix: Fix `pthread_mutex_lock()` check in test_pthread_cooperation

Fixes #844.
Fixup to #838.