Add api for shutting down standalone multis, so that tests can clean up properly.
Multi tracks sockets that are in use.

This stops clang getting confused about the ownership, and also lets us check that all socket objects have been cleaned up properly before we shutdown.