Shuffling http_response_code() function

We're grabbing the response code after we close the handler, which is
quite useless.