Fix race condition on transport stop.

When a client connection was created while the transport was stopping, the call to releaseExternalResources hung.