adjust concurrency and custodian handling

Goals:

 * Only reuse a connection when the creating and reusing contexts have
   the same custodian. Otherwise, a shutdown on the creating custodian
   closes the port for the reusing context.

 * Avoid locks in favor of a manager thread, to make concurrency handling
   kill-safe.

 * Add some weak links to avoid memory leaks in the case of
   custodian-based shutdowns.

 * Fix a subtle race condition between asking a timeout thread to exit
   (with an asynchronous request) and checking whether ports are still
   open.