net: ensure that ResolveTCPAddr(addr.String()) reproduces addr

And same for UDP.

Fixes issue 6465.

R=golang-dev, bradfitz
CC=golang-dev
https://codereview.appspot.com/13740048