ensure connection close is sent

Minor refactor to reduce code paths for setting the close header
Every response type calls write_headers