archive/tar: simplify toASCII and parseString
archive/tar: simplify toASCII and parseString

Use a simple []byte instead of bytes.Buffer to create a string.
Use bytes.IndexByte instead of our own for loop.

Change-Id: Ic4a1161d79017fd3af086a05c53d5f20a5f09326
Reviewed-on: https://go-review.googlesource.com/54752
Reviewed-by: Avelino <8efd86fb78a56a5145ed7739dcb00c78581c5375@avelino.xxx>
Reviewed-by: Ian Lance Taylor <87e9c6d529889242b7e184afb632328636553ab4@golang.org>
Run-TryBot: Joe Tsai <7277d7402195d5c2006c89f45718cf82bb3e527f@gmail.com>

golang/go,Cofyc/go,codestation/go,cloudflare/go,codestation/go,cloudflare/go,golang/go,Cofyc/go,polyverse-security/go,nawawi/go,CAFxX/go,golang/go,golang/go,cloudflare/go,akutz/go,golang/go,polyverse-security/go,codestation/go,golang/go,Cofyc/go,nawawi/go,golang/go,polyverse-security/go,codestation/go,nawawi/go,josharian/go,polyverse-security/go,Cofyc/go,nawawi/go,Cofyc/go,golang/go,akutz/go,nawawi/go,codestation/go,josharian/go,josharian/go,nawawi/go,cloudflare/go,nawawi/go,josharian/go,CAFxX/go,CAFxX/go,akutz/go,CAFxX/go,josharian/go,nawawi/go,cloudflare/go,Cofyc/go,polyverse-security/go,CAFxX/go,akutz/go,cloudflare/go,polyverse-security/go,akutz/go,akutz/go,akutz/go,codestation/go,CAFxX/go,codestation/go,Cofyc/go,cloudflare/go,christopher-henderson/Go,josharian/go,polyverse-security/go,CAFxX/go,CAFxX/go,codestation/go,Cofyc/go,josharian/go,cloudflare/go,polyverse-security/go,josharian/go,akutz/go