strings: fix Replacer bug with prefix matches

singleStringReplacer had a bug where if a string was replaced
at the beginning and no output had yet been produced into the
temp buffer before matching ended, an invalid nil check (used
as a proxy for having matched anything) meant it always
returned its input.

Fixes issue 6659

R=golang-dev, r
CC=golang-dev
https://codereview.appspot.com/16880043