dispatcher: use read/write lock since connections can change now

Previously, the connections array would always live in the same place,
only its contents would change.  Now a re-alloc can change the location
of the array, hence we need to separate read and write operations, such
that writes to the array don't cause invalid reads.