fix bug whereby sem_open leaked its own internal slots on failure