HPCC-11712 - Avoid write lock on disconnect unless neeeded

A connection disconnect was grabbing an exclusive lock to the
shared dataRWLock unconditionally, when it only needed it if it
was altering the store. This was causing extra contention and
thread serialization.

Signed-off-by: Jake Smith <jake.smith@lexisnexis.com>