psxtmcond01: Fix bug where mutex not locked and add EPERM error check

This test formerly had a bug in that it attempted to wait on a
condition variable with a Mutex that was not locked. This is
undefined by POSIX. But a recent change to match GNU/Linux behavior
resulted in finding a bug in the test.