Fix issue with attempting to set the ngx.header after sending a response