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>

rdp/rogerpack2005-golang,Triskite/willstone-goclone,rdp/rogerpack2005-golang,d0f/go-zh,rflanagan/reginaldflanagan-project1,d0f/go-zh,rflanagan/reginaldflanagan-project1,sanjosh/sanjos100-tipc,bryanxu/go-zh,webfd/go-zh,mhennings/marcohennings-go,sanjosh/sanjos100-tipc,sanjosh/sanjos100-tipc,sanjosh/sanjos100-tipc,webfd/go-zh,bryanxu/go-zh,glycerine/jeaten-go-arrayof-structof,webfd/go-zh,scirelli/scirelli-go,mhennings/marcohennings-go,Triskite/willstone-goclone,webfd/go-zh,Triskite/willstone-goclone,rflanagan/reginaldflanagan-project1,rdp/rogerpack2005-golang,glycerine/jeaten-go-arrayof-structof,webfd/go-zh,rdp/rogerpack2005-golang,Triskite/willstone-goclone,bryanxu/go-zh,sanjosh/sanjos100-tipc,mhennings/marcohennings-go,bryanxu/go-zh,glycerine/jeaten-go-arrayof-structof,rflanagan/reginaldflanagan-project1,scirelli/scirelli-go,scirelli/scirelli-go,d0f/go-zh,bryanxu/go-zh,scirelli/scirelli-go,mhennings/marcohennings-go,Triskite/willstone-goclone,rdp/rogerpack2005-golang,Triskite/willstone-goclone,scirelli/scirelli-go,glycerine/jeaten-go-arrayof-structof,sanjosh/sanjos100-tipc,mhennings/marcohennings-go,d0f/go-zh,glycerine/jeaten-go-arrayof-structof,webfd/go-zh,bryanxu/go-zh,d0f/go-zh,mhennings/marcohennings-go,Triskite/willstone-goclone,glycerine/jeaten-go-arrayof-structof,rflanagan/reginaldflanagan-project1,rflanagan/reginaldflanagan-project1,rdp/rogerpack2005-golang,glycerine/jeaten-go-arrayof-structof,d0f/go-zh,rdp/rogerpack2005-golang,sanjosh/sanjos100-tipc,webfd/go-zh,d0f/go-zh,rdp/rogerpack2005-golang,Triskite/willstone-goclone,scirelli/scirelli-go,d0f/go-zh,mhennings/marcohennings-go,sanjosh/sanjos100-tipc,scirelli/scirelli-go,rflanagan/reginaldflanagan-project1,bryanxu/go-zh,scirelli/scirelli-go,mhennings/marcohennings-go,bryanxu/go-zh,glycerine/jeaten-go-arrayof-structof,webfd/go-zh,rflanagan/reginaldflanagan-project1