Found better way with close_connection_after_writing.

Was hoping that exact function existed, and turns out it does.  I just
missed it in my first pass.  Yay.