Set Content-Type before calling WriteHeader

So I found something unfortunate here. The actual implementation of http.ResponseWriter will send the HTTP headers to the client when WriteHeader is called, causing subsequent modifications to the headers to silently fail. However, the http.ResponseRecorder will actually track modifications to the response headers after WriteHeader has been called. This means that the test case introduced in 2b4201c does not actually have any bearing on the following bugfix in 6f851ac.