Handle IPv6 literals when logging addresses.

We can't just split an address:port string with strings.Split, because the
address may be an IPv6 literal with colons. Now, we split the string, join the
pieces, and discard the last one (the port).