dispatch_addconnection: protect the connections array from reads

When extending the connections list, we use realloc, which may return a
new pointer.  Because reads were not disallowed to the connections list
while the list was extended, garbage could be seen by dispatchers,
obviously.  Make sure the dispatchers hold their read-lock for as long
as they read the connections list (including processing of the
connection, which is frequently dereferencing the pointer from the
list), such that when we aqcuire the write-lock, we block out all
readers.  This has the downside of causing a temporary block on adding a
new connection, but this should only happen sometimes.