Fix the -6 option

* The code didn't set the domain field on sockets in connect and listen
mode (but only in tunnel mode), so that the -6 option had no effect.
* Also change opt_domain to a local variable because it is only used in
main.