Flush the response after writing the headers.

@hassox @visnup

cc @daicoden