Replace getsockname with tor_getsockname

There's a lot of duplicate code in Tor that calls getsockname, then stuffs the address in a tor_addr_t.

Let's cleanup that code by replacing it with tor_getsockname where that makes sense.

For example, in #18100 (moved), we left behind duplicate code in destination_from_socket, because it was a backport, and the changes required to deduplicate it were complex.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information