IPC/semaphores: move the rwmutex handling inside semctl_down