Fixes #27 by attaching custom headers when the close request is sent