Use StringBuilder instead of concatenation

Pointed out by ctrueden: string concatenation has been showed to have
significant overhead in time and space, thus we should be using
StringBuilder.

This also removes the potential for a null header value.