Fix race conditions around connection transport