Use a pthread_rwlock_t for other mutexes, too
Recently (commit 9647e538), a rwlock is being used for the data file mutex and speeds things up by about 16%. In order for the cache, rcfile and client list mutexes to make use of rwlocks, some redesign needs to be done because a rwlock with a read-only lock needs to be released before being converted to a write-lock, and vice-versa. The mutex, as is it now, is recursive an has no need to be released before locking again.