fix stale locks left behind when pthread_create fails

this bug seems to have been around a long time.
1 file changed