encoding/xml: rewrite invalid code points to U+FFFD in Marshal, Escape

Fixes issue 4235.

R=rsc, dave, r, dr.volker.dobler
CC=golang-dev
https://codereview.appspot.com/7438051

Committer: Russ Cox <rsc@golang.org>
cmd/go: allow ~ in middle of path, just not at beginning

An earlier CL disallowed ~ anywhere in GOPATH, to avoid
problems with GOPATH='~/home' instead of GOPATH=~/home.
But ~ is only special in the shell at the beginning of each of
the paths in the list, and some paths do have ~ in the middle.
So relax the requirement slightly.

Fixes issue 4140.

R=golang-dev, dsymonds
CC=golang-dev
https://codereview.appspot.com/7799045