cmd/dist: don't fail when Mercurial is a batch file on Windows
cmd/dist: don't fail when Mercurial is a batch file on Windows

On windows Mercurial installed with easy_install typically creates
an hg.bat batch file in Python Scripts directory, which cannot be used
with CreateProcess unless full path is specified. Work around by
launching hg via cmd.exe /c.

Additionally, fix a rare FormatMessageW crash.

Fixes issue 3093.

R=golang-dev, rsc, alex.brainman, aram, jdpoirier, mattn.jp
CC=golang-dev
http://codereview.appspot.com/5937043

Committer: Russ Cox <5ad239cb8a44f659eaaee0aa1ea5b94947abe557@golang.org>

firebitsbr/golang-old,wesolows/golang,wesolows/golang-old,wesolows/golang-old,wesolows/golang,firebitsbr/golang-old,wesolows/golang-old,wesolows/golang,wesolows/golang-old,firebitsbr/golang-old,firebitsbr/golang-old,firebitsbr/golang-old,wesolows/golang,firebitsbr/golang-old,wesolows/golang-old,wesolows/golang,firebitsbr/golang-old,wesolows/golang-old,wesolows/golang,wesolows/golang-old,wesolows/golang,firebitsbr/golang-old