Fix bug in count<> agg over string inputs.

The previous coding basically assumed that the output type of an aggregate was
the same as its input type; obviously that is not entirely sound.

Per report from Josh Rosen; closes #2.