Ensure close connection header gets set

Fixes #1958

Also fixed a bug where `Connection: Keep-Alive` header was being set for
HTTP 1.0 clients when the connection was being closed.
Merge pull request #1958 from jroper/close-connection

Set `Connection: close` header when closing HTTP 1.1 connections