Make sure client id mutexes are destroyed

Also, since on Linux with glibc, pthread_mutex_init with NULL attributes
actually won't fail, we don't bother with error recovery, we just assert for
zero return. If we ever run on an os or with a library that has a more
substantial error case, we can decide how to handle errors at that point.

We make this change because if we fail to completely init all mutexes, then
we have to destroy those that DID get initialized. Much simpler to not bother
with complexity that doesn't apply to Linux.

Also, only reason pthread_mutex_destroy can fail is if it was busy. This is a
coding error and best not to proceed with a situation where part of the code
thinks an object is done with while another part of the code thinks the
object still exists.

Also, destroy the mutexes AFTER destroying the sessions since that may use
the cid_mutex...

Signed-off-by: Frank S. Filz <ffilzlnx@mindspring.com>
Make sure session mutexes are initialized and destroyed

Also, since on Linux with glibc, pthread_mutex_init with NULL attributes
actually won't fail, we don't bother with error recovery, we just assert for
zero return. If we ever run on an os or with a library that has a more
substantial error case, we can decide how to handle errors at that point.

We make this change because if we fail to completely init all mutexes, then
we have to destroy those that DID get initialized. Much simpler to not bother
with complexity that doesn't apply to Linux.

Also, only reason pthread_mutex_destroy can fail is if it was busy. This is a
coding error and best not to proceed with a situation where part of the code
thinks an object is done with while another part of the code thinks the
object still exists.

Signed-off-by: Frank S. Filz <ffilzlnx@mindspring.com>